claude-use 11.80.0 → 11.82.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/index.mjs CHANGED
@@ -163,7 +163,7 @@ function providerFilePath(directory, name, source) {
163
163
  }
164
164
  return path.join(directory, `${name}.json`);
165
165
  }
166
- var FILESYSTEM_COMPONENT_BYTES, MAX_PID_DIGITS, UUID_CHARS, ATOMIC_WRITE_OVERHEAD_BYTES, FARM_SWAP_OVERHEAD_BYTES, MAX_NAME_BYTES, FILE_NAME_PATTERN, FILE_NAME, FILE_NAME_RULE, STORED_NAME_RULE, FileNameSchema, StoredNameSchema, UnsafeNameError, InvalidProviderNameError;
166
+ var FILESYSTEM_COMPONENT_BYTES, MAX_PID_DIGITS, UUID_CHARS, ATOMIC_WRITE_OVERHEAD_BYTES, FARM_SWAP_OVERHEAD_BYTES, MAX_NAME_BYTES, FILE_NAME_PATTERN, FILE_NAME, FILE_NAME_RULE, STORED_NAME_RULE, FileNameSchema, StoredNameSchema, LABEL_FORBIDDEN, IDENTITY_LABEL_RULE, IdentityLabelSchema, UnsafeNameError, InvalidProviderNameError;
167
167
  var init_names = __esm({
168
168
  "src/config/names.ts"() {
169
169
  "use strict";
@@ -180,6 +180,9 @@ var init_names = __esm({
180
180
  STORED_NAME_RULE = `must be non-empty, at most ${String(MAX_NAME_BYTES)} bytes, not "." or "..", and contain no path separator or NUL`;
181
181
  FileNameSchema = z.string().min(1).regex(FILE_NAME, FILE_NAME_RULE);
182
182
  StoredNameSchema = z.string().min(1).max(MAX_NAME_BYTES).refine(isStoredName, STORED_NAME_RULE);
183
+ LABEL_FORBIDDEN = /[\p{Cc}\p{Zl}\p{Zp}]/u;
184
+ IDENTITY_LABEL_RULE = `must be non-empty single-line text of at most ${String(MAX_NAME_BYTES)} characters, with no control characters and no leading or trailing whitespace`;
185
+ IdentityLabelSchema = z.string().min(1).max(MAX_NAME_BYTES).refine((label) => label === label.trim() && !LABEL_FORBIDDEN.test(label), IDENTITY_LABEL_RULE);
183
186
  UnsafeNameError = class extends CliError {
184
187
  constructor(attemptedName, kind, rule = STORED_NAME_RULE, source) {
185
188
  super(`${source === void 0 ? "" : `${source}: `}${JSON.stringify(attemptedName)} is not a valid ${kind} name: a name ${rule}.`);
@@ -1103,7 +1106,7 @@ var init_schema = __esm({
1103
1106
  resumeOnLimit: z3.boolean().optional(),
1104
1107
  /** Whether a supervised session's context is compacted before its identity's quota is spent, so the resume on the next member writes a small context instead of a large one. Needs `resumeOnLimit`. Absent means false. */
1105
1108
  compactBeforeLimit: z3.boolean().optional(),
1106
- /** The share of a quota window, in whole percent, at which sessions are compacted. Absent means the launcher decides from what compacting every session on the member would cost against what its five-hour window has left. Needs `compactBeforeLimit`. */
1109
+ /** The share of a quota window, in whole percent, at which sessions are compacted. Absent means the launcher decides from what compacting every session on the member would cost against what its tightest quota window has left. Needs `compactBeforeLimit`. */
1107
1110
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
1108
1111
  }).refine((pool) => pool.compactBeforeLimit !== true || pool.resumeOnLimit === true, { message: "compactBeforeLimit needs resumeOnLimit, since a session that is not moved has no cold cache to avoid", path: ["compactBeforeLimit"] }).refine((pool) => pool.compactAtUtilisation === void 0 || pool.compactBeforeLimit === true, { message: "compactAtUtilisation needs compactBeforeLimit", path: ["compactAtUtilisation"] });
1109
1112
  WEEKDAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
@@ -1206,6 +1209,8 @@ var init_schema = __esm({
1206
1209
  IdentitySchema = z3.strictObject({
1207
1210
  $schema: z3.string().optional(),
1208
1211
  name: FileNameSchema,
1212
+ /** What the identity is for, in the person's words, drawn beside its name in `identity list` and `show`, the launch banner and the statusline. Display only: the name stays the key for lookup, paths, keychain service names and pools. */
1213
+ label: IdentityLabelSchema.optional(),
1209
1214
  defaultConfigProfile: StoredNameSchema.optional(),
1210
1215
  /** The provider this identity exists for: a launch on the identity routes through it unless `--provider`, `--no-provider` or a cascade layer's `launch.provider` says otherwise. Its sessions run on the provider's credential, so the identity needs no stored login. */
1211
1216
  provider: StoredNameSchema.optional(),
@@ -1704,6 +1709,24 @@ function evaluateWhen(when, context) {
1704
1709
  }
1705
1710
  return { status: "definite", passed: failed.length === 0, checked, failed };
1706
1711
  }
1712
+ function referencesFact(when, key) {
1713
+ if (when === void 0 || !("kind" in when)) {
1714
+ return false;
1715
+ }
1716
+ const walk2 = (node) => {
1717
+ if (Array.isArray(node)) {
1718
+ return node.some(walk2);
1719
+ }
1720
+ if (typeof node !== "object" || node === null) {
1721
+ return false;
1722
+ }
1723
+ if ("kind" in node && node.kind === "reference" && "key" in node && node.key === key) {
1724
+ return true;
1725
+ }
1726
+ return Object.values(node).some(walk2);
1727
+ };
1728
+ return walk2(when);
1729
+ }
1707
1730
  function isVacuousWhen(when) {
1708
1731
  return when !== void 0 && !("kind" in when) && Object.keys(when).length === 0;
1709
1732
  }
@@ -4740,7 +4763,7 @@ var init_package = __esm({
4740
4763
  "package.json"() {
4741
4764
  package_default = {
4742
4765
  name: "claude-use",
4743
- version: "11.80.0",
4766
+ version: "11.82.0",
4744
4767
  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.",
4745
4768
  license: "MIT",
4746
4769
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -7398,10 +7421,10 @@ function billedTokensOf(record) {
7398
7421
  const usage = record.usage;
7399
7422
  return (usage?.inputTokens ?? 0) + (usage?.cacheCreationInputTokens ?? 0) + (usage?.outputTokens ?? 0);
7400
7423
  }
7401
- function utilisationPerBilledToken(records) {
7424
+ function utilisationPerBilledToken(records, which) {
7402
7425
  const points = [];
7403
7426
  for (const record of records) {
7404
- const window = record.rateLimitHeaders === void 0 ? void 0 : parseUnifiedRateLimit(record.rateLimitHeaders)?.fiveHour;
7427
+ const window = record.rateLimitHeaders === void 0 ? void 0 : parseUnifiedRateLimit(record.rateLimitHeaders)?.[which];
7405
7428
  if (window?.utilization !== void 0 && window.resetsAt !== void 0) {
7406
7429
  points.push({ resetsAt: window.resetsAt, utilization: window.utilization, billed: billedTokensOf(record) });
7407
7430
  }
@@ -7586,14 +7609,17 @@ function rankPool(input) {
7586
7609
  }
7587
7610
  const { sticky: sticky2 } = input;
7588
7611
  const warmHere = sticky2?.identity === candidate.identity && nowMs - Date.parse(sticky2.at) <= PROMPT_CACHE_TTL_MS;
7589
- if (input.resuming && input.resumeContextTokens !== void 0 && fiveHour !== void 0 && !warmHere) {
7590
- const perToken = utilisationPerBilledToken(assessment.member.records);
7612
+ const resumeTokens = input.resumeContextTokens;
7613
+ if (input.resuming && resumeTokens !== void 0 && !warmHere) {
7591
7614
  const committed = input.committedContextTokens?.[candidate.identity] ?? 0;
7592
- const cost = perToken === void 0 ? void 0 : (input.resumeContextTokens + committed) * perToken;
7593
- if (cost !== void 0 && cost > fiveHour.remaining) {
7594
- dryAfterMs.push(0);
7595
- const alongside = committed === 0 ? "" : ` (with ${String(committed)} tokens of other conversations already moving here)`;
7596
- drySpots.push(`resuming a ${String(input.resumeContextTokens)}-token conversation here${alongside} would cost about ${percent(cost)} of the 5h window, which has ${percent(fiveHour.remaining)} left`);
7615
+ const alongside = committed === 0 ? "" : ` (with ${String(committed)} tokens of other conversations already moving here)`;
7616
+ for (const [name, label, window] of [["fiveHour", "5h", fiveHour], ["sevenDay", "7d", sevenDay]]) {
7617
+ const perToken = window === void 0 ? void 0 : utilisationPerBilledToken(assessment.member.records, name);
7618
+ const cost = perToken === void 0 ? void 0 : (resumeTokens + committed) * perToken;
7619
+ if (window !== void 0 && cost !== void 0 && cost > window.remaining) {
7620
+ dryAfterMs.push(0);
7621
+ drySpots.push(`resuming a ${String(resumeTokens)}-token conversation here${alongside} would cost about ${percent(cost)} of the ${label} window, which has ${percent(window.remaining)} left`);
7622
+ }
7597
7623
  }
7598
7624
  }
7599
7625
  if (drySpots.length === 0) {
@@ -11566,9 +11592,15 @@ function movedRows(facts) {
11566
11592
  }
11567
11593
  return [];
11568
11594
  }
11595
+ function identityText(facts) {
11596
+ if (facts.identity === void 0) {
11597
+ return "(none)";
11598
+ }
11599
+ return facts.identityLabel === void 0 ? facts.identity : `${facts.identity} (${facts.identityLabel})`;
11600
+ }
11569
11601
  function decisionRows(facts) {
11570
11602
  return [
11571
- { label: "identity", value: facts.identity ?? "(none)", detail: facts.identitySource },
11603
+ { label: "identity", value: identityText(facts), detail: facts.identitySource },
11572
11604
  ...facts.pool === void 0 ? [] : [
11573
11605
  {
11574
11606
  label: "pool",
@@ -12097,6 +12129,7 @@ function decideLaunch(params, readOnly) {
12097
12129
  return {
12098
12130
  parsedArgv,
12099
12131
  identityDecision,
12132
+ identityLabel: loadedIdentity?.config.label,
12100
12133
  poolPick,
12101
12134
  poolRanking,
12102
12135
  lastRanAs,
@@ -12127,6 +12160,7 @@ function prepareLaunch(params) {
12127
12160
  const rows = [
12128
12161
  ...decisionRows({
12129
12162
  identity: identityDecision.name,
12163
+ identityLabel: decided.identityLabel,
12130
12164
  identitySource: identityDecision.source,
12131
12165
  pool: poolPick,
12132
12166
  ranking: resolvedFlags.explain ? poolRanking : void 0,
@@ -16722,6 +16756,12 @@ function setIdentityProvider(paths, identityName, providerName) {
16722
16756
  }
16723
16757
  return applyPatch(identityJsonPath(paths, identityName), IdentitySchema, { provider: providerName });
16724
16758
  }
16759
+ function setIdentityLabel(paths, identityName, label) {
16760
+ if (!identityExists(paths, identityName)) {
16761
+ throw new IdentityNotFoundError(identityName);
16762
+ }
16763
+ return applyPatch(identityJsonPath(paths, identityName), IdentitySchema, { label });
16764
+ }
16725
16765
  function setAllowAmbientCredential(paths, identityName, allow) {
16726
16766
  if (!identityExists(paths, identityName)) {
16727
16767
  throw new IdentityNotFoundError(identityName);
@@ -16771,6 +16811,7 @@ import fs11 from "node:fs";
16771
16811
  import path29 from "node:path";
16772
16812
  init_signIn();
16773
16813
  init_identityAccounts();
16814
+ init_read();
16774
16815
 
16775
16816
  // src/codex/siwcStore.ts
16776
16817
  import { z as z26 } from "zod";
@@ -17144,6 +17185,82 @@ function describeSharedLoginMembers(poolName, shared) {
17144
17185
  return `Pool "${poolName}" lists ${joinNames(shared.members)}, which hold the same login${holder === void 0 ? "" : ` (${holder})`}, so they share one quota window. A launch ranks them as one candidate and never fails over from one to another; keep one of them in the pool.`;
17145
17186
  }
17146
17187
 
17188
+ // src/poolWindowReads.ts
17189
+ init_schema();
17190
+ init_identity();
17191
+ init_conditions();
17192
+ init_middleware();
17193
+ init_rateLimit();
17194
+ var WINDOW_NAMES = ["fiveHour", "sevenDay", "extraUsage"];
17195
+ var WINDOW_PROSE = { fiveHour: "five-hour", sevenDay: "seven-day", extraUsage: "extra-usage" };
17196
+ var WINDOW_FACTS = ["remaining", "utilization", "hoursUntilReset"];
17197
+ var DERIVED_FACTS = [{ key: "quota.burnPerHour", window: "fiveHour" }];
17198
+ function receivedWindows(snapshot) {
17199
+ const unified = snapshot?.providers[ANTHROPIC_PROVIDER]?.rateLimit?.unified;
17200
+ if (unified === void 0) {
17201
+ return void 0;
17202
+ }
17203
+ return /* @__PURE__ */ new Set([...unified.fiveHour === void 0 ? [] : ["fiveHour"], ...unified.sevenDay === void 0 ? [] : ["sevenDay"], ...soleOverageWindow(unified) === void 0 ? [] : ["extraUsage"]]);
17204
+ }
17205
+ function conditionReads(when) {
17206
+ const direct = WINDOW_NAMES.flatMap((window) => WINDOW_FACTS.some((fact) => referencesFact(when, `quota.${window}.${fact}`)) ? [{ window, reference: `quota.${window}` }] : []);
17207
+ const derived = DERIVED_FACTS.flatMap(({ key, window }) => referencesFact(when, key) ? [{ window, reference: key }] : []);
17208
+ return [...direct, ...derived];
17209
+ }
17210
+ function identitiesOf(selector, pools, visited = /* @__PURE__ */ new Set()) {
17211
+ const nested = poolNameOf(selector);
17212
+ if (nested === void 0) {
17213
+ return [selector];
17214
+ }
17215
+ const pool = pools[nested];
17216
+ if (pool === void 0 || visited.has(nested)) {
17217
+ return [];
17218
+ }
17219
+ visited.add(nested);
17220
+ return [...new Set(pool.identities.flatMap((member) => identitiesOf(poolMemberIdentity(member), pools, visited)))];
17221
+ }
17222
+ function poolWindowReadFindings(pools, windowsOf) {
17223
+ const findings = [];
17224
+ for (const [poolName, pool] of Object.entries(pools)) {
17225
+ for (const member of pool.identities) {
17226
+ if (typeof member === "string") {
17227
+ continue;
17228
+ }
17229
+ const reads = conditionReads(member.when);
17230
+ for (const identity of identitiesOf(member.identity, pools)) {
17231
+ const received = windowsOf(identity);
17232
+ for (const { window, reference } of reads) {
17233
+ if (received !== void 0 && !received.has(window)) {
17234
+ findings.push({ subject: poolName, message: `Pool "${poolName}" guards ${member.identity} with a condition that reads ${reference}, but ${identity} reports no ${WINDOW_PROSE[window]} window, so the condition is undecided for it and it always ranks last within its class.` });
17235
+ }
17236
+ }
17237
+ }
17238
+ }
17239
+ if (pool.compactBeforeLimit === true) {
17240
+ for (const identity of identitiesOf(`pool:${poolName}`, pools)) {
17241
+ const received = windowsOf(identity);
17242
+ if (received !== void 0 && !received.has("fiveHour") && !received.has("sevenDay")) {
17243
+ findings.push({ subject: poolName, message: `Pool "${poolName}" compacts before the limit, but ${identity} reports no five-hour or seven-day window, so its sessions are never compacted before the limit.` });
17244
+ }
17245
+ }
17246
+ }
17247
+ }
17248
+ return findings;
17249
+ }
17250
+ function jobWindowReadFindings(jobs, pools, windowsOf) {
17251
+ return Object.entries(jobs).flatMap(([jobName, job]) => {
17252
+ const { trigger, target } = job;
17253
+ if (!("beforeReset" in trigger)) {
17254
+ return [];
17255
+ }
17256
+ const identities = "pool" in target ? identitiesOf(`pool:${target.pool}`, pools) : identitiesOf(target.identity, pools);
17257
+ return identities.flatMap((identity) => {
17258
+ const received = windowsOf(identity);
17259
+ return received === void 0 || received.has(trigger.beforeReset) ? [] : [{ subject: jobName, message: `Job "${jobName}" runs before the ${WINDOW_PROSE[trigger.beforeReset]} window resets, but ${identity} reports no ${WINDOW_PROSE[trigger.beforeReset]} window, so the job is skipped whenever it runs as ${identity}.` }];
17260
+ });
17261
+ });
17262
+ }
17263
+
17147
17264
  // src/doctorReport.ts
17148
17265
  init_extends();
17149
17266
  var DOCTOR_SEVERITIES = ["pass", "warn", "fail"];
@@ -17512,6 +17629,17 @@ function runDoctor(params) {
17512
17629
  reportedCycles.add(key);
17513
17630
  push("pool", "fail", `Pool cycle: ${chain.join(" -> ")}. A pool cannot nest itself, directly or through another pool.`, chain[0]);
17514
17631
  }
17632
+ const { usageSnapshots } = params;
17633
+ if (usageSnapshots !== void 0) {
17634
+ const windowsOf = (identityName) => receivedWindows(usageSnapshots[identityName]);
17635
+ for (const finding of poolWindowReadFindings(pools, windowsOf)) {
17636
+ push("pool", "warn", finding.message, finding.subject);
17637
+ }
17638
+ const jobs = validatedGlobalConfig?.ok === true ? validatedGlobalConfig.data.jobs ?? {} : {};
17639
+ for (const finding of jobWindowReadFindings(jobs, pools, windowsOf)) {
17640
+ push("global-config", "warn", finding.message, finding.subject);
17641
+ }
17642
+ }
17515
17643
  const selectionExists = (selector) => {
17516
17644
  const poolName = poolNameOf(selector);
17517
17645
  return poolName === void 0 ? validIdentityNames.has(selector) : poolName in pools;
@@ -17770,6 +17898,19 @@ function collectDoctorReport(params) {
17770
17898
  const identityPath = path29.join(farmRoot, "identity.json");
17771
17899
  return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot, credentialsFilePresent: fs11.existsSync(credentialsFilePath(farmRoot)), account: readIdentityAccount(realFsPort, paths.identitiesDir, name)?.account };
17772
17900
  });
17901
+ const usageSnapshots = {};
17902
+ for (const name of identityNames) {
17903
+ try {
17904
+ const snapshot = readUsageSnapshot(realFsPort, paths.usageSnapshotsDir, name);
17905
+ if (snapshot !== void 0) {
17906
+ usageSnapshots[name] = snapshot;
17907
+ }
17908
+ } catch (error) {
17909
+ if (!(error instanceof UsageSnapshotError)) {
17910
+ throw error;
17911
+ }
17912
+ }
17913
+ }
17773
17914
  const profileNames = fs11.existsSync(paths.configProfilesDir) ? fs11.readdirSync(paths.configProfilesDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
17774
17915
  const configProfiles = profileNames.map((name) => {
17775
17916
  const profilePath = path29.join(paths.configProfilesDir, `${name}.json`);
@@ -17813,6 +17954,7 @@ function collectDoctorReport(params) {
17813
17954
  chatgptSignIn: { path: paths.chatgptSignInFile, raw: realFsPort.readFileUtf8(paths.chatgptSignInFile) },
17814
17955
  installedClaudeVersions: realInstalledClaudeVersions(),
17815
17956
  identities,
17957
+ usageSnapshots,
17816
17958
  configProfiles,
17817
17959
  providers,
17818
17960
  providerAliases: readProviderAliases(paths),
@@ -18115,6 +18257,7 @@ init_providersStore();
18115
18257
 
18116
18258
  // src/frontdoor/configSchemas.ts
18117
18259
  init_schema();
18260
+ init_names();
18118
18261
  init_statusline();
18119
18262
  import { z as z30 } from "zod";
18120
18263
  var RemovalConfirmationSchema = z30.boolean();
@@ -18141,6 +18284,7 @@ var mutationOutput = (kind, action) => z30.strictObject({ action: z30.literal(ac
18141
18284
  var storedMutationOutput = (kind, action, value) => z30.strictObject({ action: z30.literal(action), kind: z30.literal(kind), name: z30.string(), value });
18142
18285
  var IdentityValueSchema = z30.strictObject({
18143
18286
  name: z30.string(),
18287
+ label: z30.string().optional(),
18144
18288
  defaultConfigProfile: z30.string().optional(),
18145
18289
  provider: z30.string().optional(),
18146
18290
  allowAmbientCredential: z30.boolean(),
@@ -18161,6 +18305,8 @@ var ConfigNameInputSchema = z30.strictObject({ name: z30.string().min(1) });
18161
18305
  var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
18162
18306
  var ConfigIdentitySetInputSchema = z30.strictObject({
18163
18307
  name: z30.string().min(1),
18308
+ /** The identity's display label; `false` clears it. */
18309
+ label: z30.union([IdentityLabelSchema, z30.literal(false)]).optional(),
18164
18310
  defaultConfigProfile: z30.union([z30.string().min(1), z30.literal(false)]).optional(),
18165
18311
  /** The provider the identity exists for; `false` clears it. */
18166
18312
  provider: z30.union([z30.string().min(1), z30.literal(false)]).optional(),
@@ -18307,6 +18453,7 @@ function identityValue(name, paths) {
18307
18453
  }
18308
18454
  return {
18309
18455
  name: identity.name,
18456
+ ...identity.label === void 0 ? {} : { label: identity.label },
18310
18457
  ...identity.defaultConfigProfile === void 0 ? {} : { defaultConfigProfile: identity.defaultConfigProfile },
18311
18458
  ...identity.provider === void 0 ? {} : { provider: identity.provider },
18312
18459
  allowAmbientCredential: identity.allowAmbientCredential,
@@ -18341,9 +18488,9 @@ function createConfigApiRouter(deps) {
18341
18488
  return { action: "created", kind: "identity", name: input.name, value: identityValue(input.name, paths) };
18342
18489
  })
18343
18490
  ),
18344
- set: route("/rest/config/identity/set", "Update an identity's default profile, provider, ambient-credential setting, credential or anchors").input(ConfigIdentitySetInputSchema).output(ConfigIdentitySetOutputSchema).handler(
18491
+ set: route("/rest/config/identity/set", "Update an identity's label, default profile, provider, ambient-credential setting, credential or anchors").input(ConfigIdentitySetInputSchema).output(ConfigIdentitySetOutputSchema).handler(
18345
18492
  ({ input }) => guarded(() => {
18346
- requireChange(input.defaultConfigProfile !== void 0 || input.provider !== void 0 || input.allowAmbientCredential !== void 0 || input.credential !== void 0 || input.anchors !== void 0, "defaultConfigProfile, provider, allowAmbientCredential, credential or anchors");
18493
+ requireChange(input.label !== void 0 || input.defaultConfigProfile !== void 0 || input.provider !== void 0 || input.allowAmbientCredential !== void 0 || input.credential !== void 0 || input.anchors !== void 0, "label, defaultConfigProfile, provider, allowAmbientCredential, credential or anchors");
18347
18494
  if (!identityExists(paths, input.name)) {
18348
18495
  throw new IdentityNotFoundError(input.name);
18349
18496
  }
@@ -18353,6 +18500,9 @@ function createConfigApiRouter(deps) {
18353
18500
  if (typeof input.provider === "string") {
18354
18501
  requireProviderExists(paths, input.provider);
18355
18502
  }
18503
+ if (input.label !== void 0) {
18504
+ setIdentityLabel(paths, input.name, input.label === false ? void 0 : input.label);
18505
+ }
18356
18506
  if (input.defaultConfigProfile !== void 0) {
18357
18507
  setDefaultConfigProfile(paths, input.name, input.defaultConfigProfile === false ? void 0 : input.defaultConfigProfile);
18358
18508
  }
@@ -2117,7 +2117,7 @@ type PoolPreference = z.infer<typeof PoolPreferenceSchema>;
2117
2117
  *
2118
2118
  * A member entry may name another pool (`pool:<name>`), which is ranked with its own preference and contributes its pick at the entry's position; see `PoolMemberSchema`. The graph must stay acyclic, which `pool add`/`pool set` enforce and `doctor` re-checks.
2119
2119
  *
2120
- * `compactBeforeLimit` makes the supervised sessions compact their context while their member can still afford it, at `compactAtUtilisation` percent of a window or, when that is absent, when compacting every session on the member would cost more than its five-hour window has left.
2120
+ * `compactBeforeLimit` makes the supervised sessions compact their context while their member can still afford it, at `compactAtUtilisation` percent of a window or, when that is absent, when compacting every session on the member would cost more than the window it has the smallest share left of (the seven-day one for an account with no five-hour window) has left.
2121
2121
  *
2122
2122
  * `resumeOnLimit` makes an interactive launch from the pool supervised: when its identity runs out of quota, the launcher stops the session and resumes the same conversation under the next ranked member, on the same terminal. Absent means false.
2123
2123
  *
@@ -5412,6 +5412,7 @@ type GlobalConfig = z.infer<typeof GlobalConfigSchema>;
5412
5412
  declare const IdentitySchema: z.ZodObject<{
5413
5413
  $schema: z.ZodOptional<z.ZodString>;
5414
5414
  name: z.ZodString;
5415
+ label: z.ZodOptional<z.ZodString>;
5415
5416
  defaultConfigProfile: z.ZodOptional<z.ZodString>;
5416
5417
  provider: z.ZodOptional<z.ZodString>;
5417
5418
  allowAmbientCredential: z.ZodDefault<z.ZodBoolean>;
@@ -9310,6 +9311,8 @@ interface RunDoctorParams {
9310
9311
  readonly raw: string | undefined;
9311
9312
  };
9312
9313
  readonly identities: readonly DoctorIdentityInput[];
9314
+ /** Each identity's last recorded usage snapshot, by identity name. Omit to skip checking that pools and jobs read only windows their identities receive; an identity missing from it has no readable snapshot, so what it receives is unknown and nothing is reported for it. */
9315
+ readonly usageSnapshots?: Readonly<Record<string, UsageSnapshot>>;
9313
9316
  readonly configProfiles: readonly DoctorConfigProfileInput[];
9314
9317
  readonly providers: readonly DoctorProviderInput[];
9315
9318
  /** The recorded former names of renamed providers. Omit to leave them out of the findings. */
@@ -9476,6 +9479,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
9476
9479
  name: zod.ZodString;
9477
9480
  value: zod.ZodObject<{
9478
9481
  name: zod.ZodString;
9482
+ label: zod.ZodOptional<zod.ZodString>;
9479
9483
  defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
9480
9484
  provider: zod.ZodOptional<zod.ZodString>;
9481
9485
  allowAmbientCredential: zod.ZodBoolean;
@@ -9529,6 +9533,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
9529
9533
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
9530
9534
  set: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
9531
9535
  name: zod.ZodString;
9536
+ label: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
9532
9537
  defaultConfigProfile: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
9533
9538
  provider: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
9534
9539
  allowAmbientCredential: zod.ZodOptional<zod.ZodBoolean>;
@@ -9583,6 +9588,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
9583
9588
  name: zod.ZodString;
9584
9589
  value: zod.ZodObject<{
9585
9590
  name: zod.ZodString;
9591
+ label: zod.ZodOptional<zod.ZodString>;
9586
9592
  defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
9587
9593
  provider: zod.ZodOptional<zod.ZodString>;
9588
9594
  allowAmbientCredential: zod.ZodBoolean;
@@ -16548,6 +16554,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16548
16554
  name: zod.ZodString;
16549
16555
  value: zod.ZodObject<{
16550
16556
  name: zod.ZodString;
16557
+ label: zod.ZodOptional<zod.ZodString>;
16551
16558
  defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
16552
16559
  provider: zod.ZodOptional<zod.ZodString>;
16553
16560
  allowAmbientCredential: zod.ZodBoolean;
@@ -16601,6 +16608,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16601
16608
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
16602
16609
  set: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
16603
16610
  name: zod.ZodString;
16611
+ label: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
16604
16612
  defaultConfigProfile: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
16605
16613
  provider: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
16606
16614
  allowAmbientCredential: zod.ZodOptional<zod.ZodBoolean>;
@@ -16655,6 +16663,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16655
16663
  name: zod.ZodString;
16656
16664
  value: zod.ZodObject<{
16657
16665
  name: zod.ZodString;
16666
+ label: zod.ZodOptional<zod.ZodString>;
16658
16667
  defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
16659
16668
  provider: zod.ZodOptional<zod.ZodString>;
16660
16669
  allowAmbientCredential: zod.ZodBoolean;
@@ -21074,6 +21083,7 @@ declare const ConfigIdentityAddOutputSchema: z.ZodObject<{
21074
21083
  name: z.ZodString;
21075
21084
  value: z.ZodObject<{
21076
21085
  name: z.ZodString;
21086
+ label: z.ZodOptional<z.ZodString>;
21077
21087
  defaultConfigProfile: z.ZodOptional<z.ZodString>;
21078
21088
  provider: z.ZodOptional<z.ZodString>;
21079
21089
  allowAmbientCredential: z.ZodBoolean;
@@ -21128,6 +21138,7 @@ declare const ConfigIdentityAddOutputSchema: z.ZodObject<{
21128
21138
  /** `defaultConfigProfile: false` clears it; `credential: false` removes the credential block, returning the identity to its stored login. At least one field must be present. */
21129
21139
  declare const ConfigIdentitySetInputSchema: z.ZodObject<{
21130
21140
  name: z.ZodString;
21141
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
21131
21142
  defaultConfigProfile: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
21132
21143
  provider: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
21133
21144
  allowAmbientCredential: z.ZodOptional<z.ZodBoolean>;
@@ -21183,6 +21194,7 @@ declare const ConfigIdentitySetOutputSchema: z.ZodObject<{
21183
21194
  name: z.ZodString;
21184
21195
  value: z.ZodObject<{
21185
21196
  name: z.ZodString;
21197
+ label: z.ZodOptional<z.ZodString>;
21186
21198
  defaultConfigProfile: z.ZodOptional<z.ZodString>;
21187
21199
  provider: z.ZodOptional<z.ZodString>;
21188
21200
  allowAmbientCredential: z.ZodBoolean;
@@ -26514,7 +26526,7 @@ interface ConditionContext {
26514
26526
  readonly branchDetached?: boolean;
26515
26527
  readonly env: Readonly<Record<string, string | undefined>>;
26516
26528
  /**
26517
- * The pool-selection facts a member entry's policy condition reads. Present only when the condition guards a pool member, so the same reference namespace serves the cascade and the pool: `quota.fiveHour.remaining`, `quota.fiveHour.utilization`, `quota.fiveHour.hoursUntilReset`, the same three under `quota.sevenDay`, and under `quota.extraUsage` for an account metered by extra usage alone (an Enterprise one with no plan windows), `quota.burnPerHour` (the five-hour window's observed utilisation pace, in fractions per hour), `session.resuming` (this launch resumes or continues a conversation) and `session.lastPickHoursAgo` (how long ago this directory last picked this member). Conversation context is deliberately not provided: nothing the door holds knows it, so a condition referencing it is indeterminate, naming the missing fact, rather than guessed.
26529
+ * The pool-selection facts a member entry's policy condition reads. Present only when the condition guards a pool member, so the same reference namespace serves the cascade and the pool: `quota.fiveHour.remaining`, `quota.fiveHour.utilization`, `quota.fiveHour.hoursUntilReset`, the same three under `quota.sevenDay`, and under `quota.extraUsage` for an account metered by extra usage alone (an Enterprise one with no plan windows), `quota.burnPerHour` (the five-hour window's observed utilisation pace, in fractions per hour, so absent for an account without that window), `session.resuming` (this launch resumes or continues a conversation) and `session.lastPickHoursAgo` (how long ago this directory last picked this member). Conversation context is deliberately not provided: nothing the door holds knows it, so a condition referencing it is indeterminate, naming the missing fact, rather than guessed. A window the account does not have is absent in the same way, never a guessed zero: a verified Ultra account reports no five-hour window, so a condition reading `quota.fiveHour.*` or `quota.burnPerHour` is indeterminate for it on every evaluation, which `doctor` reports.
26518
26530
  */
26519
26531
  readonly pool?: {
26520
26532
  readonly fiveHour?: PoolWindowFacts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.80.0",
3
+ "version": "11.82.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>",