claude-use 11.29.0 → 11.31.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/README.md CHANGED
@@ -98,7 +98,7 @@ agent-shim profile set <name> [--category <category>=<bool>]... [--entry <catego
98
98
  agent-shim profile set <name> [--extends <profile>]... [--no-extends] [--description <text> | --no-description] [--json]
99
99
  agent-shim profile set <name> [--[no-]launch-skip-permissions] [--[no-]launch-remote-control] [--[no-]launch-headroom] [--[no-]launch-track-usage]
100
100
  agent-shim profile set <name> [--launch-claude-version <version> | --no-launch-claude-version] [--json] [--json]
101
- agent-shim profile set <name> [--launch-delay <duration> | --no-launch-delay] [--[no-]launch-pause] [--json]
101
+ agent-shim profile set <name> [--launch-delay <duration> | --no-launch-delay] [--[no-]launch-pause] [--[no-]launch-explain] [--json]
102
102
  agent-shim profile set <name> [--launch-provider <provider> | --no-launch-provider] [--json]
103
103
  agent-shim profile list [--json]
104
104
  agent-shim profile show <name> [--json]
@@ -183,6 +183,7 @@ agent-shim run [@<identity>] [launch flags] [claude arguments]
183
183
  # --[no-]skip-permissions --[no-]remote-control --[no-]headroom --[no-]track-usage --[no-]wait
184
184
  # --claude-version <version> run exactly this installed Claude Code version
185
185
  # --delay <duration> wait this long after the launcher's own output before starting claude; --[no-]pause waits for a key press instead
186
+ # --[no-]explain with @pool:<name>, list every member the pick ranked and why, not only the one picked
186
187
  # --native run the real claude with nothing from agent-shim applied; cannot be combined with the flags above
187
188
  claude @<identity> ... # the same, once `agent-shim shim enable` has run
188
189
  ```
package/dist/cli.cjs CHANGED
@@ -27031,7 +27031,9 @@ var init_schema = __esm({
27031
27031
  /** How long the launcher waits after its own output before it starts claude, so that output can be read before Claude Code takes over the terminal (`5s`, `500ms`). Applies only when a terminal is watching. */
27032
27032
  delay: external_exports.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
27033
27033
  /** Whether the launcher waits for a key press after its own output before it starts claude. Takes the place of `delay` when both are set. Applies only when a terminal is watching. */
27034
- pause: external_exports.boolean().optional()
27034
+ pause: external_exports.boolean().optional(),
27035
+ /** Whether the launcher's report, for a launch that picks from a pool, lists every member the pick ranked with why each stands where it does, and not only the member it picked. */
27036
+ explain: external_exports.boolean().optional()
27035
27037
  });
27036
27038
  CREDENTIAL_TARGETS = ["bearer", "apiKey", "oauthToken"];
27037
27039
  PROVIDER_CREDENTIAL_TARGETS = ["bearer", "apiKey"];
@@ -32571,6 +32573,9 @@ function flattenLayers(layers, options) {
32571
32573
  if (layer.launch.pause !== void 0) {
32572
32574
  launch.pause = layer.launch.pause;
32573
32575
  }
32576
+ if (layer.launch.explain !== void 0) {
32577
+ launch.explain = layer.launch.explain;
32578
+ }
32574
32579
  }
32575
32580
  if (layer.entries === void 0) {
32576
32581
  continue;
@@ -34318,7 +34323,7 @@ var init_package = __esm({
34318
34323
  "package.json"() {
34319
34324
  package_default = {
34320
34325
  name: "claude-use",
34321
- version: "11.29.0",
34326
+ version: "11.31.0",
34322
34327
  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.",
34323
34328
  license: "MIT",
34324
34329
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -63125,7 +63130,8 @@ var init_argv = __esm({
63125
63130
  { flag: "--skip-permissions", key: "skipPermissions" },
63126
63131
  { flag: "--remote-control", key: "remoteControl" },
63127
63132
  { flag: "--wait", key: "wait" },
63128
- { flag: "--pause", key: "pause" }
63133
+ { flag: "--pause", key: "pause" },
63134
+ { flag: "--explain", key: "explain" }
63129
63135
  ];
63130
63136
  LAUNCHER_FLAG_NAMES = [
63131
63137
  ...VALUED_FLAGS,
@@ -63314,6 +63320,7 @@ function resolveLaunchFlags(params) {
63314
63320
  headroom: params.flags?.headroom ?? parseEnvBool("AGENT_SHIM_HEADROOM", params.env.AGENT_SHIM_HEADROOM) ?? params.cascade?.headroom ?? false,
63315
63321
  trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
63316
63322
  pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
63323
+ explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
63317
63324
  delayMs: resolveDelayMs(params)
63318
63325
  };
63319
63326
  }
@@ -63687,6 +63694,18 @@ var init_hold = __esm({
63687
63694
  }
63688
63695
  });
63689
63696
 
63697
+ // src/usage/candidateText.ts
63698
+ function candidateHeading(candidate) {
63699
+ const score = candidate.score === void 0 ? "" : ` score ${candidate.score.toFixed(2)}${candidate.scoreWindow === "fiveHour" ? " by 5h reset" : " by 7d reset"}`;
63700
+ const dry = candidate.feasible ? "" : " (5h would run dry)";
63701
+ return `[${candidate.class}${score}]${dry}`;
63702
+ }
63703
+ var init_candidateText = __esm({
63704
+ "src/usage/candidateText.ts"() {
63705
+ "use strict";
63706
+ }
63707
+ });
63708
+
63690
63709
  // src/launcher/launchReport.ts
63691
63710
  function poolDetail(pool) {
63692
63711
  const [reason] = pool.reasons;
@@ -63695,6 +63714,12 @@ function poolDetail(pool) {
63695
63714
  }
63696
63715
  return reason === void 0 ? {} : { detail: reason };
63697
63716
  }
63717
+ function rankingNotes(ranking, picked) {
63718
+ return ranking.flatMap((candidate, index) => [
63719
+ `${String(index + 1)}. ${candidate.identity} ${candidateHeading(candidate)}${candidate.identity === picked ? " (picked)" : ""}`,
63720
+ ` ${candidate.reasons.join("; ")}`
63721
+ ]);
63722
+ }
63698
63723
  function decisionRows(facts) {
63699
63724
  return [
63700
63725
  { label: "identity", value: facts.identity ?? "(none)", detail: facts.identitySource },
@@ -63702,7 +63727,8 @@ function decisionRows(facts) {
63702
63727
  {
63703
63728
  label: "pool",
63704
63729
  value: facts.pool.name,
63705
- ...poolDetail(facts.pool)
63730
+ ...poolDetail(facts.pool),
63731
+ ...facts.ranking === void 0 ? {} : { notes: rankingNotes(facts.ranking, facts.identity) }
63706
63732
  }
63707
63733
  ],
63708
63734
  ...facts.profile === void 0 ? [] : [{ label: "profile", value: facts.profile.name, detail: facts.profile.source }],
@@ -63737,6 +63763,7 @@ function noteRow(text2) {
63737
63763
  var init_launchReport = __esm({
63738
63764
  "src/launcher/launchReport.ts"() {
63739
63765
  "use strict";
63766
+ init_candidateText();
63740
63767
  }
63741
63768
  });
63742
63769
 
@@ -64230,6 +64257,9 @@ function resolveAntigravityConfig(config2) {
64230
64257
  const target = overrides[tier];
64231
64258
  return target === void 0 ? ANTIGRAVITY_DEFAULT_TIER_MODELS[tier] : candidatesOf(target);
64232
64259
  };
64260
+ if (!aliases.has(AUTO_ALIAS)) {
64261
+ aliases.set(AUTO_ALIAS, [...new Set(CLAUDE_TIERS.flatMap(tierModel))]);
64262
+ }
64233
64263
  return {
64234
64264
  mode: config2?.mode ?? ANTIGRAVITY_DEFAULT_MODE,
64235
64265
  defaultModel: config2?.defaultModel ?? ANTIGRAVITY_DEFAULT_MODEL,
@@ -64496,7 +64526,7 @@ function translateRequest(request7, config2, routing) {
64496
64526
  toolNames
64497
64527
  };
64498
64528
  }
64499
- var import_node_crypto16, CONTEXT_MARKER_1M, BACKEND_FAMILY_PREFIXES, BACKEND_CLAUDE_NAME, EFFORT_TO_BUDGET, BILLING_HEADER_LINE, ANTIGRAVITY_TOOL_NAME_LIMIT, TOOL_NAME_HASH_CHARS, NON_TEXT_TOOL_RESULT, EMPTY_SCHEMA, EFFORT_SUFFIXES;
64529
+ var import_node_crypto16, AUTO_ALIAS, CONTEXT_MARKER_1M, BACKEND_FAMILY_PREFIXES, BACKEND_CLAUDE_NAME, EFFORT_TO_BUDGET, BILLING_HEADER_LINE, ANTIGRAVITY_TOOL_NAME_LIMIT, TOOL_NAME_HASH_CHARS, NON_TEXT_TOOL_RESULT, EMPTY_SCHEMA, EFFORT_SUFFIXES;
64500
64530
  var init_translate = __esm({
64501
64531
  "src/antigravity/translate.ts"() {
64502
64532
  "use strict";
@@ -64505,6 +64535,7 @@ var init_translate = __esm({
64505
64535
  init_signatures();
64506
64536
  init_schema();
64507
64537
  init_anthropic();
64538
+ AUTO_ALIAS = "auto";
64508
64539
  CONTEXT_MARKER_1M = "[1m]";
64509
64540
  BACKEND_FAMILY_PREFIXES = ["gemini-", "antigravity-", "gpt-oss-"];
64510
64541
  BACKEND_CLAUDE_NAME = /^claude-.+-(?:low|medium|high|thinking)$/;
@@ -64854,9 +64885,10 @@ function antigravityRows(provider) {
64854
64885
  const aliases = [...config2.aliases].flatMap(([alias, candidates]) => {
64855
64886
  const [first] = candidates;
64856
64887
  const behavesAs = first === void 0 ? void 0 : behavesAsOf.get(first);
64857
- return behavesAs === void 0 ? [] : [{ model: alias, label: labelOf(alias), description: `Alias for ${candidates.join(", then ")}`, behavesAs }];
64888
+ const description = alias === AUTO_ALIAS ? `Routes each request to a backend model with quota left, best first (${String(candidates.length)} models)` : `Alias for ${candidates.join(", then ")}`;
64889
+ return behavesAs === void 0 ? [] : [{ model: alias, label: labelOf(alias), description, behavesAs }];
64858
64890
  });
64859
- return [...tiers, ...aliases];
64891
+ return [...aliases.filter((row) => row.model === AUTO_ALIAS), ...tiers, ...aliases.filter((row) => row.model !== AUTO_ALIAS)];
64860
64892
  }
64861
64893
  function codexRows(provider) {
64862
64894
  const config2 = resolveCodexConfig(provider.codex);
@@ -64991,6 +65023,7 @@ function resolvePoolLaunch(params) {
64991
65023
  identity: pick2.identity,
64992
65024
  explanation: `pool ${poolName}: ${move}${pick2.reasons.slice(0, REASONS_LOGGED).join("; ")}`,
64993
65025
  reasons: pick2.reasons,
65026
+ candidates: graph.ranking.candidates,
64994
65027
  ...movedOff === void 0 ? {} : { movedOff }
64995
65028
  };
64996
65029
  }
@@ -65165,7 +65198,8 @@ function pickFromPool(decided, params, parsedArgv, readOnly) {
65165
65198
  }
65166
65199
  return {
65167
65200
  identityDecision: { ...decided, name: resolution.identity },
65168
- poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } }
65201
+ poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } },
65202
+ poolRanking: resolution.candidates
65169
65203
  };
65170
65204
  }
65171
65205
  function decideLaunch(params, readOnly) {
@@ -65192,7 +65226,7 @@ function decideLaunch(params, readOnly) {
65192
65226
  return trimmed === "" ? void 0 : trimmed;
65193
65227
  }
65194
65228
  });
65195
- const { identityDecision, poolPick } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
65229
+ const { identityDecision, poolPick, poolRanking } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
65196
65230
  const farmIdentity = configDirEscapeHatchApplies ? void 0 : identityDecision.name;
65197
65231
  const farm = farmIdentity === void 0 ? void 0 : params.farm;
65198
65232
  if (!readOnly && farm !== void 0 && farmIdentity !== void 0) {
@@ -65328,6 +65362,7 @@ function decideLaunch(params, readOnly) {
65328
65362
  ...parsedArgv.headroom === void 0 ? {} : { headroom: parsedArgv.headroom },
65329
65363
  ...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
65330
65364
  ...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
65365
+ ...parsedArgv.explain === void 0 ? {} : { explain: parsedArgv.explain },
65331
65366
  ...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
65332
65367
  }
65333
65368
  });
@@ -65364,6 +65399,7 @@ function decideLaunch(params, readOnly) {
65364
65399
  parsedArgv,
65365
65400
  identityDecision,
65366
65401
  poolPick,
65402
+ poolRanking,
65367
65403
  notes,
65368
65404
  configDirEscapeHatch: configDirEscapeHatchApplies,
65369
65405
  farmIdentity,
@@ -65384,12 +65420,13 @@ function prepareLaunch(params) {
65384
65420
  const { paths, proc, log } = params;
65385
65421
  const { env } = proc;
65386
65422
  const decided = decideLaunch(params, false);
65387
- const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
65423
+ const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, poolRanking, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
65388
65424
  const rows = [
65389
65425
  ...decisionRows({
65390
65426
  identity: identityDecision.name,
65391
65427
  identitySource: identityDecision.source,
65392
65428
  pool: poolPick,
65429
+ ranking: resolvedFlags.explain ? poolRanking : void 0,
65393
65430
  profile: configProfileDecision.name === void 0 ? void 0 : { name: configProfileDecision.name, source: configProfileDecision.source },
65394
65431
  provider: resolvedProvider === void 0 ? void 0 : { name: resolvedProvider.name, credential: `${resolvedProvider.credential.target} from ${describeSource(resolvedProvider.credential.source)}` },
65395
65432
  identityCredential: identityCredential === void 0 ? void 0 : `${identityCredential.target} from ${describeSource(identityCredential.source)}`
@@ -111520,6 +111557,9 @@ function applyProfileChange(paths, name, change) {
111520
111557
  if (change.launchPause !== void 0) {
111521
111558
  launchPatch.pause = change.launchPause;
111522
111559
  }
111560
+ if (change.launchExplain !== void 0) {
111561
+ launchPatch.explain = change.launchExplain;
111562
+ }
111523
111563
  if (Object.keys(launchPatch).length > 0) {
111524
111564
  setProfileLaunchFlags(paths, name, launchPatch);
111525
111565
  touched = true;
@@ -112806,7 +112846,7 @@ function registerProfileCommand(program2, deps) {
112806
112846
  withExamples(
112807
112847
  profile.command("set <name>").description(
112808
112848
  "Update a configuration profile's categories, entries, extends list, description or launch settings. With no options on a terminal, walks through its categories."
112809
- ).option("--category <category=bool>", "Share (true) or hide (false) a whole category (repeatable).", collectBoolPair).option("--entry <path=bool>", "Share (true) or hide (false) one <category>/<path> entry (repeatable).", collectBoolPair).option("--extends <profile>", "Replace the extends list with these profiles (repeatable, in order).", collectRepeated).option("--no-extends", "Clear the extends list.").option("--description <text>", "Replace the description.").option("--no-description", "Clear the description.").option("--launch-skip-permissions", "Launches under this profile skip permission prompts.").option("--no-launch-skip-permissions", "Launches under this profile keep permission prompts.").option("--launch-remote-control", "Launches under this profile enable Remote Control.").option("--no-launch-remote-control", "Launches under this profile leave Remote Control off.").option("--launch-headroom", "Launches under this profile route through headroom.").option("--no-launch-headroom", "Launches under this profile route direct.").option("--launch-track-usage", "Launches under this profile route through the front door so their requests and quota are recorded, with no headroom needed.").option("--no-launch-track-usage", "Launches under this profile are not recorded unless a provider or headroom routes them anyway.").option("--launch-provider <provider>", "Launches under this profile route through this provider.").option("--no-launch-provider", "Clear this profile's provider selection.").option("--launch-claude-version <version>", "Launches under this profile run exactly this installed Claude Code version (such as 2.1.220); a version that is not installed fails the launch.").option("--no-launch-claude-version", "Clear this profile's Claude Code version pin.").option("--launch-delay <duration>", "Launches under this profile wait this long (such as 5s) after the launcher's own output before starting claude, so the output can be read.", parseDurationLiteral).option("--no-launch-delay", "Clear this profile's launch delay.").option("--launch-pause", "Launches under this profile wait for a key press after the launcher's own output before starting claude.").option("--no-launch-pause", "Launches under this profile start claude without waiting for a key press.").option("--json", "Print the result as JSON.").action(async (name, allOptions) => {
112849
+ ).option("--category <category=bool>", "Share (true) or hide (false) a whole category (repeatable).", collectBoolPair).option("--entry <path=bool>", "Share (true) or hide (false) one <category>/<path> entry (repeatable).", collectBoolPair).option("--extends <profile>", "Replace the extends list with these profiles (repeatable, in order).", collectRepeated).option("--no-extends", "Clear the extends list.").option("--description <text>", "Replace the description.").option("--no-description", "Clear the description.").option("--launch-skip-permissions", "Launches under this profile skip permission prompts.").option("--no-launch-skip-permissions", "Launches under this profile keep permission prompts.").option("--launch-remote-control", "Launches under this profile enable Remote Control.").option("--no-launch-remote-control", "Launches under this profile leave Remote Control off.").option("--launch-headroom", "Launches under this profile route through headroom.").option("--no-launch-headroom", "Launches under this profile route direct.").option("--launch-track-usage", "Launches under this profile route through the front door so their requests and quota are recorded, with no headroom needed.").option("--no-launch-track-usage", "Launches under this profile are not recorded unless a provider or headroom routes them anyway.").option("--launch-provider <provider>", "Launches under this profile route through this provider.").option("--no-launch-provider", "Clear this profile's provider selection.").option("--launch-claude-version <version>", "Launches under this profile run exactly this installed Claude Code version (such as 2.1.220); a version that is not installed fails the launch.").option("--no-launch-claude-version", "Clear this profile's Claude Code version pin.").option("--launch-delay <duration>", "Launches under this profile wait this long (such as 5s) after the launcher's own output before starting claude, so the output can be read.", parseDurationLiteral).option("--no-launch-delay", "Clear this profile's launch delay.").option("--launch-pause", "Launches under this profile wait for a key press after the launcher's own output before starting claude.").option("--no-launch-pause", "Launches under this profile start claude without waiting for a key press.").option("--launch-explain", "Launches under this profile that pick from a pool list every member the pick ranked and why, in the launcher's report.").option("--no-launch-explain", "Launches under this profile name only the member a pool pick chose.").option("--json", "Print the result as JSON.").action(async (name, allOptions) => {
112810
112850
  const { json: json2, ...options } = allOptions;
112811
112851
  requireProfileExists(paths, name);
112812
112852
  if (Object.entries(allOptions).every(([key, value2]) => key === "json" || value2 === void 0)) {
@@ -127708,7 +127748,8 @@ var ConfigProfileSetInputSchema = external_exports.strictObject({
127708
127748
  provider: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional(),
127709
127749
  claudeVersion: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional(),
127710
127750
  delay: external_exports.union([external_exports.string().regex(DURATION_RE), external_exports.literal(false)]).optional(),
127711
- pause: external_exports.boolean().optional()
127751
+ pause: external_exports.boolean().optional(),
127752
+ explain: external_exports.boolean().optional()
127712
127753
  }).optional()
127713
127754
  });
127714
127755
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
@@ -127920,7 +127961,8 @@ function createConfigApiRouter(deps) {
127920
127961
  ...launch?.provider === void 0 ? {} : { launchProvider: launch.provider },
127921
127962
  ...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
127922
127963
  ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
127923
- ...launch?.pause === void 0 ? {} : { launchPause: launch.pause }
127964
+ ...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
127965
+ ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
127924
127966
  });
127925
127967
  return { action: "updated", kind: "profile", name: input2.name, value: profileValue(input2.name, paths) };
127926
127968
  })
@@ -128221,6 +128263,7 @@ var LaunchFlagsSchema = external_exports.strictObject({
128221
128263
  headroom: external_exports.boolean(),
128222
128264
  trackUsage: external_exports.boolean(),
128223
128265
  pause: external_exports.boolean(),
128266
+ explain: external_exports.boolean(),
128224
128267
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
128225
128268
  delayMs: external_exports.number()
128226
128269
  });
@@ -146123,13 +146166,12 @@ init_cliError();
146123
146166
  init_schema();
146124
146167
  init_schema();
146125
146168
  init_realPorts();
146169
+ init_candidateText();
146126
146170
  init_preflight();
146127
146171
  function formatPoolPick(report, nowMs) {
146128
146172
  const head = report.pick === void 0 ? `Pool ${report.pool}: every member is refused right now${report.earliestReturn === void 0 ? "" : `; ${report.earliestReturn.identity} returns at ${report.earliestReturn.at} (in ${formatAge(Date.parse(report.earliestReturn.at) - nowMs)})`}` : `Pool ${report.pool}: a launch from ${report.directory} would run as ${report.pick}`;
146129
146173
  const rows = report.candidates.map((candidate, index) => {
146130
- const score = candidate.score === void 0 ? "" : ` score ${candidate.score.toFixed(2)}${candidate.scoreWindow === "fiveHour" ? " by 5h reset" : " by 7d reset"}`;
146131
- const dry = candidate.feasible ? "" : " (5h would run dry)";
146132
- return ` ${String(index + 1)}. ${candidate.identity} [${candidate.class}${score}]${dry}
146174
+ return ` ${String(index + 1)}. ${candidate.identity} ${candidateHeading(candidate)}
146133
146175
  ${candidate.reasons.join("; ")}`;
146134
146176
  });
146135
146177
  return [head, ...rows, ...report.missing.map((name) => ` (skipped: ${name} is not an identity)`), ...report.stickyProblem === void 0 ? [] : [`Note: ${report.stickyProblem}; the last-pick record was ignored.`]];
@@ -147029,11 +147071,12 @@ Launching:
147029
147071
  --[no-]wait with @pool:<name>, sleep until the earliest member returns when all are refused
147030
147072
  --delay <duration> wait this long (5s, 500ms) after the launcher's own output before starting claude
147031
147073
  --[no-]pause wait for a key press after the launcher's own output before starting claude
147074
+ --[no-]explain with @pool:<name>, list every member the pick ranked and why, not only the one picked
147032
147075
  --native run the real claude with nothing from agent-shim applied (no other launch flag allowed)
147033
147076
 
147034
147077
  Environment:
147035
147078
  AGENT_SHIM_IDENTITY, AGENT_SHIM_CONFIG_PROFILE, AGENT_SHIM_SKIP_PERMISSIONS,
147036
- AGENT_SHIM_REMOTE_CONTROL, AGENT_SHIM_HEADROOM, AGENT_SHIM_TRACK_USAGE, AGENT_SHIM_DELAY, AGENT_SHIM_PAUSE, AGENT_SHIM_ALLOW_AMBIENT_CREDENTIAL,
147079
+ AGENT_SHIM_REMOTE_CONTROL, AGENT_SHIM_HEADROOM, AGENT_SHIM_TRACK_USAGE, AGENT_SHIM_DELAY, AGENT_SHIM_PAUSE, AGENT_SHIM_EXPLAIN, AGENT_SHIM_ALLOW_AMBIENT_CREDENTIAL,
147037
147080
  AGENT_SHIM_CATEGORY_OVERRIDE, AGENT_SHIM_ENTRY_OVERRIDE, AGENT_SHIM_HOME,
147038
147081
  AGENT_SHIM_DEBUG (print stack traces), NO_COLOR. Booleans are true, false, 1 or 0.
147039
147082
 
@@ -147755,6 +147798,7 @@ function otherLaunchFlags(parsed) {
147755
147798
  ...parsed.claudeVersion === void 0 ? [] : ["--claude-version"],
147756
147799
  ...parsed.delay === void 0 ? [] : ["--delay"],
147757
147800
  ...parsed.pause === void 0 ? [] : ["--[no-]pause"],
147801
+ ...parsed.explain === void 0 ? [] : ["--[no-]explain"],
147758
147802
  ...parsed.headroom === void 0 ? [] : ["--[no-]headroom"],
147759
147803
  ...parsed.trackUsage === void 0 ? [] : ["--[no-]track-usage"],
147760
147804
  ...parsed.skipPermissions === void 0 ? [] : ["--[no-]skip-permissions"],
package/dist/index.cjs CHANGED
@@ -289,7 +289,9 @@ var init_schema = __esm({
289
289
  /** How long the launcher waits after its own output before it starts claude, so that output can be read before Claude Code takes over the terminal (`5s`, `500ms`). Applies only when a terminal is watching. */
290
290
  delay: import_zod.z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
291
291
  /** Whether the launcher waits for a key press after its own output before it starts claude. Takes the place of `delay` when both are set. Applies only when a terminal is watching. */
292
- pause: import_zod.z.boolean().optional()
292
+ pause: import_zod.z.boolean().optional(),
293
+ /** Whether the launcher's report, for a launch that picks from a pool, lists every member the pick ranked with why each stands where it does, and not only the member it picked. */
294
+ explain: import_zod.z.boolean().optional()
293
295
  });
294
296
  CREDENTIAL_TARGETS = ["bearer", "apiKey", "oauthToken"];
295
297
  PROVIDER_CREDENTIAL_TARGETS = ["bearer", "apiKey"];
@@ -1398,6 +1400,9 @@ function flattenLayers(layers, options) {
1398
1400
  if (layer.launch.pause !== void 0) {
1399
1401
  launch.pause = layer.launch.pause;
1400
1402
  }
1403
+ if (layer.launch.explain !== void 0) {
1404
+ launch.explain = layer.launch.explain;
1405
+ }
1401
1406
  }
1402
1407
  if (layer.entries === void 0) {
1403
1408
  continue;
@@ -2978,7 +2983,7 @@ var init_package = __esm({
2978
2983
  "package.json"() {
2979
2984
  package_default = {
2980
2985
  name: "claude-use",
2981
- version: "11.29.0",
2986
+ version: "11.31.0",
2982
2987
  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.",
2983
2988
  license: "MIT",
2984
2989
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -7578,7 +7583,8 @@ var init_argv = __esm({
7578
7583
  { flag: "--skip-permissions", key: "skipPermissions" },
7579
7584
  { flag: "--remote-control", key: "remoteControl" },
7580
7585
  { flag: "--wait", key: "wait" },
7581
- { flag: "--pause", key: "pause" }
7586
+ { flag: "--pause", key: "pause" },
7587
+ { flag: "--explain", key: "explain" }
7582
7588
  ];
7583
7589
  LAUNCHER_FLAG_NAMES = [
7584
7590
  ...VALUED_FLAGS,
@@ -7767,6 +7773,7 @@ function resolveLaunchFlags(params) {
7767
7773
  headroom: params.flags?.headroom ?? parseEnvBool("AGENT_SHIM_HEADROOM", params.env.AGENT_SHIM_HEADROOM) ?? params.cascade?.headroom ?? false,
7768
7774
  trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
7769
7775
  pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
7776
+ explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
7770
7777
  delayMs: resolveDelayMs(params)
7771
7778
  };
7772
7779
  }
@@ -8106,6 +8113,18 @@ var init_hold = __esm({
8106
8113
  }
8107
8114
  });
8108
8115
 
8116
+ // src/usage/candidateText.ts
8117
+ function candidateHeading(candidate) {
8118
+ const score = candidate.score === void 0 ? "" : ` score ${candidate.score.toFixed(2)}${candidate.scoreWindow === "fiveHour" ? " by 5h reset" : " by 7d reset"}`;
8119
+ const dry = candidate.feasible ? "" : " (5h would run dry)";
8120
+ return `[${candidate.class}${score}]${dry}`;
8121
+ }
8122
+ var init_candidateText = __esm({
8123
+ "src/usage/candidateText.ts"() {
8124
+ "use strict";
8125
+ }
8126
+ });
8127
+
8109
8128
  // src/launcher/launchReport.ts
8110
8129
  function poolDetail(pool) {
8111
8130
  const [reason] = pool.reasons;
@@ -8114,6 +8133,12 @@ function poolDetail(pool) {
8114
8133
  }
8115
8134
  return reason === void 0 ? {} : { detail: reason };
8116
8135
  }
8136
+ function rankingNotes(ranking, picked) {
8137
+ return ranking.flatMap((candidate, index) => [
8138
+ `${String(index + 1)}. ${candidate.identity} ${candidateHeading(candidate)}${candidate.identity === picked ? " (picked)" : ""}`,
8139
+ ` ${candidate.reasons.join("; ")}`
8140
+ ]);
8141
+ }
8117
8142
  function decisionRows(facts) {
8118
8143
  return [
8119
8144
  { label: "identity", value: facts.identity ?? "(none)", detail: facts.identitySource },
@@ -8121,7 +8146,8 @@ function decisionRows(facts) {
8121
8146
  {
8122
8147
  label: "pool",
8123
8148
  value: facts.pool.name,
8124
- ...poolDetail(facts.pool)
8149
+ ...poolDetail(facts.pool),
8150
+ ...facts.ranking === void 0 ? {} : { notes: rankingNotes(facts.ranking, facts.identity) }
8125
8151
  }
8126
8152
  ],
8127
8153
  ...facts.profile === void 0 ? [] : [{ label: "profile", value: facts.profile.name, detail: facts.profile.source }],
@@ -8156,6 +8182,7 @@ function noteRow(text) {
8156
8182
  var init_launchReport = __esm({
8157
8183
  "src/launcher/launchReport.ts"() {
8158
8184
  "use strict";
8185
+ init_candidateText();
8159
8186
  }
8160
8187
  });
8161
8188
 
@@ -8268,6 +8295,9 @@ function resolveAntigravityConfig(config) {
8268
8295
  const target = overrides[tier];
8269
8296
  return target === void 0 ? ANTIGRAVITY_DEFAULT_TIER_MODELS[tier] : candidatesOf(target);
8270
8297
  };
8298
+ if (!aliases.has(AUTO_ALIAS)) {
8299
+ aliases.set(AUTO_ALIAS, [...new Set(CLAUDE_TIERS.flatMap(tierModel))]);
8300
+ }
8271
8301
  return {
8272
8302
  mode: config?.mode ?? ANTIGRAVITY_DEFAULT_MODE,
8273
8303
  defaultModel: config?.defaultModel ?? ANTIGRAVITY_DEFAULT_MODEL,
@@ -8286,6 +8316,7 @@ function resolveAntigravityConfig(config) {
8286
8316
  }
8287
8317
  };
8288
8318
  }
8319
+ var AUTO_ALIAS;
8289
8320
  var init_translate = __esm({
8290
8321
  "src/antigravity/translate.ts"() {
8291
8322
  "use strict";
@@ -8293,6 +8324,7 @@ var init_translate = __esm({
8293
8324
  init_signatures();
8294
8325
  init_schema();
8295
8326
  init_anthropic();
8327
+ AUTO_ALIAS = "auto";
8296
8328
  }
8297
8329
  });
8298
8330
 
@@ -8404,9 +8436,10 @@ function antigravityRows(provider) {
8404
8436
  const aliases = [...config.aliases].flatMap(([alias, candidates]) => {
8405
8437
  const [first] = candidates;
8406
8438
  const behavesAs = first === void 0 ? void 0 : behavesAsOf.get(first);
8407
- return behavesAs === void 0 ? [] : [{ model: alias, label: labelOf(alias), description: `Alias for ${candidates.join(", then ")}`, behavesAs }];
8439
+ const description = alias === AUTO_ALIAS ? `Routes each request to a backend model with quota left, best first (${String(candidates.length)} models)` : `Alias for ${candidates.join(", then ")}`;
8440
+ return behavesAs === void 0 ? [] : [{ model: alias, label: labelOf(alias), description, behavesAs }];
8408
8441
  });
8409
- return [...tiers, ...aliases];
8442
+ return [...aliases.filter((row) => row.model === AUTO_ALIAS), ...tiers, ...aliases.filter((row) => row.model !== AUTO_ALIAS)];
8410
8443
  }
8411
8444
  function codexRows(provider) {
8412
8445
  const config = resolveCodexConfig(provider.codex);
@@ -8541,6 +8574,7 @@ function resolvePoolLaunch(params) {
8541
8574
  identity: pick.identity,
8542
8575
  explanation: `pool ${poolName}: ${move}${pick.reasons.slice(0, REASONS_LOGGED).join("; ")}`,
8543
8576
  reasons: pick.reasons,
8577
+ candidates: graph.ranking.candidates,
8544
8578
  ...movedOff === void 0 ? {} : { movedOff }
8545
8579
  };
8546
8580
  }
@@ -8715,7 +8749,8 @@ function pickFromPool(decided, params, parsedArgv, readOnly) {
8715
8749
  }
8716
8750
  return {
8717
8751
  identityDecision: { ...decided, name: resolution.identity },
8718
- poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } }
8752
+ poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } },
8753
+ poolRanking: resolution.candidates
8719
8754
  };
8720
8755
  }
8721
8756
  function decideLaunch(params, readOnly) {
@@ -8742,7 +8777,7 @@ function decideLaunch(params, readOnly) {
8742
8777
  return trimmed === "" ? void 0 : trimmed;
8743
8778
  }
8744
8779
  });
8745
- const { identityDecision, poolPick } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
8780
+ const { identityDecision, poolPick, poolRanking } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
8746
8781
  const farmIdentity = configDirEscapeHatchApplies ? void 0 : identityDecision.name;
8747
8782
  const farm = farmIdentity === void 0 ? void 0 : params.farm;
8748
8783
  if (!readOnly && farm !== void 0 && farmIdentity !== void 0) {
@@ -8878,6 +8913,7 @@ function decideLaunch(params, readOnly) {
8878
8913
  ...parsedArgv.headroom === void 0 ? {} : { headroom: parsedArgv.headroom },
8879
8914
  ...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
8880
8915
  ...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
8916
+ ...parsedArgv.explain === void 0 ? {} : { explain: parsedArgv.explain },
8881
8917
  ...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
8882
8918
  }
8883
8919
  });
@@ -8914,6 +8950,7 @@ function decideLaunch(params, readOnly) {
8914
8950
  parsedArgv,
8915
8951
  identityDecision,
8916
8952
  poolPick,
8953
+ poolRanking,
8917
8954
  notes,
8918
8955
  configDirEscapeHatch: configDirEscapeHatchApplies,
8919
8956
  farmIdentity,
@@ -8934,12 +8971,13 @@ function prepareLaunch(params) {
8934
8971
  const { paths, proc, log } = params;
8935
8972
  const { env } = proc;
8936
8973
  const decided = decideLaunch(params, false);
8937
- const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
8974
+ const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, poolRanking, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
8938
8975
  const rows = [
8939
8976
  ...decisionRows({
8940
8977
  identity: identityDecision.name,
8941
8978
  identitySource: identityDecision.source,
8942
8979
  pool: poolPick,
8980
+ ranking: resolvedFlags.explain ? poolRanking : void 0,
8943
8981
  profile: configProfileDecision.name === void 0 ? void 0 : { name: configProfileDecision.name, source: configProfileDecision.source },
8944
8982
  provider: resolvedProvider === void 0 ? void 0 : { name: resolvedProvider.name, credential: `${resolvedProvider.credential.target} from ${describeSource(resolvedProvider.credential.source)}` },
8945
8983
  identityCredential: identityCredential === void 0 ? void 0 : `${identityCredential.target} from ${describeSource(identityCredential.source)}`
@@ -13949,6 +13987,9 @@ function applyProfileChange(paths, name, change) {
13949
13987
  if (change.launchPause !== void 0) {
13950
13988
  launchPatch.pause = change.launchPause;
13951
13989
  }
13990
+ if (change.launchExplain !== void 0) {
13991
+ launchPatch.explain = change.launchExplain;
13992
+ }
13952
13993
  if (Object.keys(launchPatch).length > 0) {
13953
13994
  setProfileLaunchFlags(paths, name, launchPatch);
13954
13995
  touched = true;
@@ -16166,7 +16207,8 @@ var ConfigProfileSetInputSchema = import_zod24.z.strictObject({
16166
16207
  provider: import_zod24.z.union([import_zod24.z.string().min(1), import_zod24.z.literal(false)]).optional(),
16167
16208
  claudeVersion: import_zod24.z.union([import_zod24.z.string().min(1), import_zod24.z.literal(false)]).optional(),
16168
16209
  delay: import_zod24.z.union([import_zod24.z.string().regex(DURATION_RE), import_zod24.z.literal(false)]).optional(),
16169
- pause: import_zod24.z.boolean().optional()
16210
+ pause: import_zod24.z.boolean().optional(),
16211
+ explain: import_zod24.z.boolean().optional()
16170
16212
  }).optional()
16171
16213
  });
16172
16214
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
@@ -16378,7 +16420,8 @@ function createConfigApiRouter(deps) {
16378
16420
  ...launch?.provider === void 0 ? {} : { launchProvider: launch.provider },
16379
16421
  ...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
16380
16422
  ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
16381
- ...launch?.pause === void 0 ? {} : { launchPause: launch.pause }
16423
+ ...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
16424
+ ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
16382
16425
  });
16383
16426
  return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
16384
16427
  })
@@ -16688,6 +16731,7 @@ var LaunchFlagsSchema = import_zod26.z.strictObject({
16688
16731
  headroom: import_zod26.z.boolean(),
16689
16732
  trackUsage: import_zod26.z.boolean(),
16690
16733
  pause: import_zod26.z.boolean(),
16734
+ explain: import_zod26.z.boolean(),
16691
16735
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
16692
16736
  delayMs: import_zod26.z.number()
16693
16737
  });
package/dist/index.mjs CHANGED
@@ -267,7 +267,9 @@ var init_schema = __esm({
267
267
  /** How long the launcher waits after its own output before it starts claude, so that output can be read before Claude Code takes over the terminal (`5s`, `500ms`). Applies only when a terminal is watching. */
268
268
  delay: z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
269
269
  /** Whether the launcher waits for a key press after its own output before it starts claude. Takes the place of `delay` when both are set. Applies only when a terminal is watching. */
270
- pause: z.boolean().optional()
270
+ pause: z.boolean().optional(),
271
+ /** Whether the launcher's report, for a launch that picks from a pool, lists every member the pick ranked with why each stands where it does, and not only the member it picked. */
272
+ explain: z.boolean().optional()
271
273
  });
272
274
  CREDENTIAL_TARGETS = ["bearer", "apiKey", "oauthToken"];
273
275
  PROVIDER_CREDENTIAL_TARGETS = ["bearer", "apiKey"];
@@ -1376,6 +1378,9 @@ function flattenLayers(layers, options) {
1376
1378
  if (layer.launch.pause !== void 0) {
1377
1379
  launch.pause = layer.launch.pause;
1378
1380
  }
1381
+ if (layer.launch.explain !== void 0) {
1382
+ launch.explain = layer.launch.explain;
1383
+ }
1379
1384
  }
1380
1385
  if (layer.entries === void 0) {
1381
1386
  continue;
@@ -2954,7 +2959,7 @@ var init_package = __esm({
2954
2959
  "package.json"() {
2955
2960
  package_default = {
2956
2961
  name: "claude-use",
2957
- version: "11.29.0",
2962
+ version: "11.31.0",
2958
2963
  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.",
2959
2964
  license: "MIT",
2960
2965
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -7551,7 +7556,8 @@ var init_argv = __esm({
7551
7556
  { flag: "--skip-permissions", key: "skipPermissions" },
7552
7557
  { flag: "--remote-control", key: "remoteControl" },
7553
7558
  { flag: "--wait", key: "wait" },
7554
- { flag: "--pause", key: "pause" }
7559
+ { flag: "--pause", key: "pause" },
7560
+ { flag: "--explain", key: "explain" }
7555
7561
  ];
7556
7562
  LAUNCHER_FLAG_NAMES = [
7557
7563
  ...VALUED_FLAGS,
@@ -7741,6 +7747,7 @@ function resolveLaunchFlags(params) {
7741
7747
  headroom: params.flags?.headroom ?? parseEnvBool("AGENT_SHIM_HEADROOM", params.env.AGENT_SHIM_HEADROOM) ?? params.cascade?.headroom ?? false,
7742
7748
  trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
7743
7749
  pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
7750
+ explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
7744
7751
  delayMs: resolveDelayMs(params)
7745
7752
  };
7746
7753
  }
@@ -8078,6 +8085,18 @@ var init_hold = __esm({
8078
8085
  }
8079
8086
  });
8080
8087
 
8088
+ // src/usage/candidateText.ts
8089
+ function candidateHeading(candidate) {
8090
+ const score = candidate.score === void 0 ? "" : ` score ${candidate.score.toFixed(2)}${candidate.scoreWindow === "fiveHour" ? " by 5h reset" : " by 7d reset"}`;
8091
+ const dry = candidate.feasible ? "" : " (5h would run dry)";
8092
+ return `[${candidate.class}${score}]${dry}`;
8093
+ }
8094
+ var init_candidateText = __esm({
8095
+ "src/usage/candidateText.ts"() {
8096
+ "use strict";
8097
+ }
8098
+ });
8099
+
8081
8100
  // src/launcher/launchReport.ts
8082
8101
  function poolDetail(pool) {
8083
8102
  const [reason] = pool.reasons;
@@ -8086,6 +8105,12 @@ function poolDetail(pool) {
8086
8105
  }
8087
8106
  return reason === void 0 ? {} : { detail: reason };
8088
8107
  }
8108
+ function rankingNotes(ranking, picked) {
8109
+ return ranking.flatMap((candidate, index) => [
8110
+ `${String(index + 1)}. ${candidate.identity} ${candidateHeading(candidate)}${candidate.identity === picked ? " (picked)" : ""}`,
8111
+ ` ${candidate.reasons.join("; ")}`
8112
+ ]);
8113
+ }
8089
8114
  function decisionRows(facts) {
8090
8115
  return [
8091
8116
  { label: "identity", value: facts.identity ?? "(none)", detail: facts.identitySource },
@@ -8093,7 +8118,8 @@ function decisionRows(facts) {
8093
8118
  {
8094
8119
  label: "pool",
8095
8120
  value: facts.pool.name,
8096
- ...poolDetail(facts.pool)
8121
+ ...poolDetail(facts.pool),
8122
+ ...facts.ranking === void 0 ? {} : { notes: rankingNotes(facts.ranking, facts.identity) }
8097
8123
  }
8098
8124
  ],
8099
8125
  ...facts.profile === void 0 ? [] : [{ label: "profile", value: facts.profile.name, detail: facts.profile.source }],
@@ -8128,6 +8154,7 @@ function noteRow(text) {
8128
8154
  var init_launchReport = __esm({
8129
8155
  "src/launcher/launchReport.ts"() {
8130
8156
  "use strict";
8157
+ init_candidateText();
8131
8158
  }
8132
8159
  });
8133
8160
 
@@ -8240,6 +8267,9 @@ function resolveAntigravityConfig(config) {
8240
8267
  const target = overrides[tier];
8241
8268
  return target === void 0 ? ANTIGRAVITY_DEFAULT_TIER_MODELS[tier] : candidatesOf(target);
8242
8269
  };
8270
+ if (!aliases.has(AUTO_ALIAS)) {
8271
+ aliases.set(AUTO_ALIAS, [...new Set(CLAUDE_TIERS.flatMap(tierModel))]);
8272
+ }
8243
8273
  return {
8244
8274
  mode: config?.mode ?? ANTIGRAVITY_DEFAULT_MODE,
8245
8275
  defaultModel: config?.defaultModel ?? ANTIGRAVITY_DEFAULT_MODEL,
@@ -8258,6 +8288,7 @@ function resolveAntigravityConfig(config) {
8258
8288
  }
8259
8289
  };
8260
8290
  }
8291
+ var AUTO_ALIAS;
8261
8292
  var init_translate = __esm({
8262
8293
  "src/antigravity/translate.ts"() {
8263
8294
  "use strict";
@@ -8265,6 +8296,7 @@ var init_translate = __esm({
8265
8296
  init_signatures();
8266
8297
  init_schema();
8267
8298
  init_anthropic();
8299
+ AUTO_ALIAS = "auto";
8268
8300
  }
8269
8301
  });
8270
8302
 
@@ -8376,9 +8408,10 @@ function antigravityRows(provider) {
8376
8408
  const aliases = [...config.aliases].flatMap(([alias, candidates]) => {
8377
8409
  const [first] = candidates;
8378
8410
  const behavesAs = first === void 0 ? void 0 : behavesAsOf.get(first);
8379
- return behavesAs === void 0 ? [] : [{ model: alias, label: labelOf(alias), description: `Alias for ${candidates.join(", then ")}`, behavesAs }];
8411
+ const description = alias === AUTO_ALIAS ? `Routes each request to a backend model with quota left, best first (${String(candidates.length)} models)` : `Alias for ${candidates.join(", then ")}`;
8412
+ return behavesAs === void 0 ? [] : [{ model: alias, label: labelOf(alias), description, behavesAs }];
8380
8413
  });
8381
- return [...tiers, ...aliases];
8414
+ return [...aliases.filter((row) => row.model === AUTO_ALIAS), ...tiers, ...aliases.filter((row) => row.model !== AUTO_ALIAS)];
8382
8415
  }
8383
8416
  function codexRows(provider) {
8384
8417
  const config = resolveCodexConfig(provider.codex);
@@ -8513,6 +8546,7 @@ function resolvePoolLaunch(params) {
8513
8546
  identity: pick.identity,
8514
8547
  explanation: `pool ${poolName}: ${move}${pick.reasons.slice(0, REASONS_LOGGED).join("; ")}`,
8515
8548
  reasons: pick.reasons,
8549
+ candidates: graph.ranking.candidates,
8516
8550
  ...movedOff === void 0 ? {} : { movedOff }
8517
8551
  };
8518
8552
  }
@@ -8689,7 +8723,8 @@ function pickFromPool(decided, params, parsedArgv, readOnly) {
8689
8723
  }
8690
8724
  return {
8691
8725
  identityDecision: { ...decided, name: resolution.identity },
8692
- poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } }
8726
+ poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } },
8727
+ poolRanking: resolution.candidates
8693
8728
  };
8694
8729
  }
8695
8730
  function decideLaunch(params, readOnly) {
@@ -8716,7 +8751,7 @@ function decideLaunch(params, readOnly) {
8716
8751
  return trimmed === "" ? void 0 : trimmed;
8717
8752
  }
8718
8753
  });
8719
- const { identityDecision, poolPick } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
8754
+ const { identityDecision, poolPick, poolRanking } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
8720
8755
  const farmIdentity = configDirEscapeHatchApplies ? void 0 : identityDecision.name;
8721
8756
  const farm = farmIdentity === void 0 ? void 0 : params.farm;
8722
8757
  if (!readOnly && farm !== void 0 && farmIdentity !== void 0) {
@@ -8852,6 +8887,7 @@ function decideLaunch(params, readOnly) {
8852
8887
  ...parsedArgv.headroom === void 0 ? {} : { headroom: parsedArgv.headroom },
8853
8888
  ...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
8854
8889
  ...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
8890
+ ...parsedArgv.explain === void 0 ? {} : { explain: parsedArgv.explain },
8855
8891
  ...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
8856
8892
  }
8857
8893
  });
@@ -8888,6 +8924,7 @@ function decideLaunch(params, readOnly) {
8888
8924
  parsedArgv,
8889
8925
  identityDecision,
8890
8926
  poolPick,
8927
+ poolRanking,
8891
8928
  notes,
8892
8929
  configDirEscapeHatch: configDirEscapeHatchApplies,
8893
8930
  farmIdentity,
@@ -8908,12 +8945,13 @@ function prepareLaunch(params) {
8908
8945
  const { paths, proc, log } = params;
8909
8946
  const { env } = proc;
8910
8947
  const decided = decideLaunch(params, false);
8911
- const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
8948
+ const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, poolRanking, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
8912
8949
  const rows = [
8913
8950
  ...decisionRows({
8914
8951
  identity: identityDecision.name,
8915
8952
  identitySource: identityDecision.source,
8916
8953
  pool: poolPick,
8954
+ ranking: resolvedFlags.explain ? poolRanking : void 0,
8917
8955
  profile: configProfileDecision.name === void 0 ? void 0 : { name: configProfileDecision.name, source: configProfileDecision.source },
8918
8956
  provider: resolvedProvider === void 0 ? void 0 : { name: resolvedProvider.name, credential: `${resolvedProvider.credential.target} from ${describeSource(resolvedProvider.credential.source)}` },
8919
8957
  identityCredential: identityCredential === void 0 ? void 0 : `${identityCredential.target} from ${describeSource(identityCredential.source)}`
@@ -13536,6 +13574,9 @@ function applyProfileChange(paths, name, change) {
13536
13574
  if (change.launchPause !== void 0) {
13537
13575
  launchPatch.pause = change.launchPause;
13538
13576
  }
13577
+ if (change.launchExplain !== void 0) {
13578
+ launchPatch.explain = change.launchExplain;
13579
+ }
13539
13580
  if (Object.keys(launchPatch).length > 0) {
13540
13581
  setProfileLaunchFlags(paths, name, launchPatch);
13541
13582
  touched = true;
@@ -15753,7 +15794,8 @@ var ConfigProfileSetInputSchema = z24.strictObject({
15753
15794
  provider: z24.union([z24.string().min(1), z24.literal(false)]).optional(),
15754
15795
  claudeVersion: z24.union([z24.string().min(1), z24.literal(false)]).optional(),
15755
15796
  delay: z24.union([z24.string().regex(DURATION_RE), z24.literal(false)]).optional(),
15756
- pause: z24.boolean().optional()
15797
+ pause: z24.boolean().optional(),
15798
+ explain: z24.boolean().optional()
15757
15799
  }).optional()
15758
15800
  });
15759
15801
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
@@ -15965,7 +16007,8 @@ function createConfigApiRouter(deps) {
15965
16007
  ...launch?.provider === void 0 ? {} : { launchProvider: launch.provider },
15966
16008
  ...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
15967
16009
  ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
15968
- ...launch?.pause === void 0 ? {} : { launchPause: launch.pause }
16010
+ ...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
16011
+ ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
15969
16012
  });
15970
16013
  return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
15971
16014
  })
@@ -16275,6 +16318,7 @@ var LaunchFlagsSchema = z26.strictObject({
16275
16318
  headroom: z26.boolean(),
16276
16319
  trackUsage: z26.boolean(),
16277
16320
  pause: z26.boolean(),
16321
+ explain: z26.boolean(),
16278
16322
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
16279
16323
  delayMs: z26.number()
16280
16324
  });
@@ -278,6 +278,7 @@ declare const LaunchSchema: z.ZodObject<{
278
278
  claudeVersion: z.ZodOptional<z.ZodString>;
279
279
  delay: z.ZodOptional<z.ZodString>;
280
280
  pause: z.ZodOptional<z.ZodBoolean>;
281
+ explain: z.ZodOptional<z.ZodBoolean>;
281
282
  }, z.core.$strict>;
282
283
  type LaunchFlags = z.infer<typeof LaunchSchema>;
283
284
  /**
@@ -861,6 +862,7 @@ declare const ConfigProfileSchema: z.ZodObject<{
861
862
  claudeVersion: z.ZodOptional<z.ZodString>;
862
863
  delay: z.ZodOptional<z.ZodString>;
863
864
  pause: z.ZodOptional<z.ZodBoolean>;
865
+ explain: z.ZodOptional<z.ZodBoolean>;
864
866
  }, z.core.$strict>>;
865
867
  }, z.core.$strict>;
866
868
  type ConfigProfile = z.infer<typeof ConfigProfileSchema>;
@@ -1069,6 +1071,7 @@ declare const DirectoryRuleSchema: z.ZodObject<{
1069
1071
  claudeVersion: z.ZodOptional<z.ZodString>;
1070
1072
  delay: z.ZodOptional<z.ZodString>;
1071
1073
  pause: z.ZodOptional<z.ZodBoolean>;
1074
+ explain: z.ZodOptional<z.ZodBoolean>;
1072
1075
  }, z.core.$strict>>;
1073
1076
  path: z.ZodString;
1074
1077
  configProfile: z.ZodOptional<z.ZodString>;
@@ -1250,6 +1253,7 @@ declare const DirectoryRulesSchema: z.ZodObject<{
1250
1253
  claudeVersion: z.ZodOptional<z.ZodString>;
1251
1254
  delay: z.ZodOptional<z.ZodString>;
1252
1255
  pause: z.ZodOptional<z.ZodBoolean>;
1256
+ explain: z.ZodOptional<z.ZodBoolean>;
1253
1257
  }, z.core.$strict>>;
1254
1258
  path: z.ZodString;
1255
1259
  configProfile: z.ZodOptional<z.ZodString>;
@@ -1432,6 +1436,7 @@ declare const PortableConfigSchema: z.ZodObject<{
1432
1436
  claudeVersion: z.ZodOptional<z.ZodString>;
1433
1437
  delay: z.ZodOptional<z.ZodString>;
1434
1438
  pause: z.ZodOptional<z.ZodBoolean>;
1439
+ explain: z.ZodOptional<z.ZodBoolean>;
1435
1440
  }, z.core.$strict>>;
1436
1441
  configProfile: z.ZodOptional<z.ZodString>;
1437
1442
  identity: z.ZodOptional<z.ZodString>;
@@ -1638,6 +1643,7 @@ declare const GlobalConfigSchema: z.ZodObject<{
1638
1643
  claudeVersion: z.ZodOptional<z.ZodString>;
1639
1644
  delay: z.ZodOptional<z.ZodString>;
1640
1645
  pause: z.ZodOptional<z.ZodBoolean>;
1646
+ explain: z.ZodOptional<z.ZodBoolean>;
1641
1647
  }, z.core.$strict>>;
1642
1648
  headroom: z.ZodOptional<z.ZodObject<{
1643
1649
  source: z.ZodOptional<z.ZodString>;
@@ -5990,6 +5996,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
5990
5996
  claudeVersion: zod.ZodOptional<zod.ZodString>;
5991
5997
  delay: zod.ZodOptional<zod.ZodString>;
5992
5998
  pause: zod.ZodOptional<zod.ZodBoolean>;
5999
+ explain: zod.ZodOptional<zod.ZodBoolean>;
5993
6000
  }, zod_v4_core.$strict>>;
5994
6001
  }, zod_v4_core.$strict>;
5995
6002
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
@@ -6008,6 +6015,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
6008
6015
  claudeVersion: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
6009
6016
  delay: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
6010
6017
  pause: zod.ZodOptional<zod.ZodBoolean>;
6018
+ explain: zod.ZodOptional<zod.ZodBoolean>;
6011
6019
  }, zod_v4_core.$strict>>;
6012
6020
  }, zod_v4_core.$strict>, zod.ZodObject<{
6013
6021
  action: zod.ZodLiteral<"updated">;
@@ -6113,6 +6121,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
6113
6121
  claudeVersion: zod.ZodOptional<zod.ZodString>;
6114
6122
  delay: zod.ZodOptional<zod.ZodString>;
6115
6123
  pause: zod.ZodOptional<zod.ZodBoolean>;
6124
+ explain: zod.ZodOptional<zod.ZodBoolean>;
6116
6125
  }, zod_v4_core.$strict>>;
6117
6126
  }, zod_v4_core.$strict>;
6118
6127
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
@@ -6715,6 +6724,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
6715
6724
  claudeVersion: zod.ZodOptional<zod.ZodString>;
6716
6725
  delay: zod.ZodOptional<zod.ZodString>;
6717
6726
  pause: zod.ZodOptional<zod.ZodBoolean>;
6727
+ explain: zod.ZodOptional<zod.ZodBoolean>;
6718
6728
  }, zod_v4_core.$strict>>;
6719
6729
  path: zod.ZodString;
6720
6730
  configProfile: zod.ZodOptional<zod.ZodString>;
@@ -6901,6 +6911,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
6901
6911
  claudeVersion: zod.ZodOptional<zod.ZodString>;
6902
6912
  delay: zod.ZodOptional<zod.ZodString>;
6903
6913
  pause: zod.ZodOptional<zod.ZodBoolean>;
6914
+ explain: zod.ZodOptional<zod.ZodBoolean>;
6904
6915
  }, zod_v4_core.$strict>>;
6905
6916
  path: zod.ZodString;
6906
6917
  configProfile: zod.ZodOptional<zod.ZodString>;
@@ -7232,6 +7243,8 @@ interface ResolvedLaunchFlags {
7232
7243
  readonly trackUsage: boolean;
7233
7244
  /** Whether the launcher waits for a key press after its own output before it starts claude. */
7234
7245
  readonly pause: boolean;
7246
+ /** Whether the launch's report lists every pool member the pick ranked and why, and not only the one picked. */
7247
+ readonly explain: boolean;
7235
7248
  /** How long the launcher waits after its own output before it starts claude, in milliseconds; zero for no wait. */
7236
7249
  readonly delayMs: number;
7237
7250
  }
@@ -7524,6 +7537,7 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
7524
7537
  headroom: zod.ZodBoolean;
7525
7538
  trackUsage: zod.ZodBoolean;
7526
7539
  pause: zod.ZodBoolean;
7540
+ explain: zod.ZodBoolean;
7527
7541
  delayMs: zod.ZodNumber;
7528
7542
  }, zod_v4_core.$strict>;
7529
7543
  claudeVersion: zod.ZodOptional<zod.ZodObject<{
@@ -8642,6 +8656,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
8642
8656
  headroom: zod.ZodBoolean;
8643
8657
  trackUsage: zod.ZodBoolean;
8644
8658
  pause: zod.ZodBoolean;
8659
+ explain: zod.ZodBoolean;
8645
8660
  delayMs: zod.ZodNumber;
8646
8661
  }, zod_v4_core.$strict>;
8647
8662
  claudeVersion: zod.ZodOptional<zod.ZodObject<{
@@ -9012,6 +9027,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9012
9027
  claudeVersion: zod.ZodOptional<zod.ZodString>;
9013
9028
  delay: zod.ZodOptional<zod.ZodString>;
9014
9029
  pause: zod.ZodOptional<zod.ZodBoolean>;
9030
+ explain: zod.ZodOptional<zod.ZodBoolean>;
9015
9031
  }, zod_v4_core.$strict>>;
9016
9032
  }, zod_v4_core.$strict>;
9017
9033
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
@@ -9030,6 +9046,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9030
9046
  claudeVersion: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
9031
9047
  delay: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
9032
9048
  pause: zod.ZodOptional<zod.ZodBoolean>;
9049
+ explain: zod.ZodOptional<zod.ZodBoolean>;
9033
9050
  }, zod_v4_core.$strict>>;
9034
9051
  }, zod_v4_core.$strict>, zod.ZodObject<{
9035
9052
  action: zod.ZodLiteral<"updated">;
@@ -9135,6 +9152,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9135
9152
  claudeVersion: zod.ZodOptional<zod.ZodString>;
9136
9153
  delay: zod.ZodOptional<zod.ZodString>;
9137
9154
  pause: zod.ZodOptional<zod.ZodBoolean>;
9155
+ explain: zod.ZodOptional<zod.ZodBoolean>;
9138
9156
  }, zod_v4_core.$strict>>;
9139
9157
  }, zod_v4_core.$strict>;
9140
9158
  }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
@@ -9737,6 +9755,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9737
9755
  claudeVersion: zod.ZodOptional<zod.ZodString>;
9738
9756
  delay: zod.ZodOptional<zod.ZodString>;
9739
9757
  pause: zod.ZodOptional<zod.ZodBoolean>;
9758
+ explain: zod.ZodOptional<zod.ZodBoolean>;
9740
9759
  }, zod_v4_core.$strict>>;
9741
9760
  path: zod.ZodString;
9742
9761
  configProfile: zod.ZodOptional<zod.ZodString>;
@@ -9923,6 +9942,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9923
9942
  claudeVersion: zod.ZodOptional<zod.ZodString>;
9924
9943
  delay: zod.ZodOptional<zod.ZodString>;
9925
9944
  pause: zod.ZodOptional<zod.ZodBoolean>;
9945
+ explain: zod.ZodOptional<zod.ZodBoolean>;
9926
9946
  }, zod_v4_core.$strict>>;
9927
9947
  path: zod.ZodString;
9928
9948
  configProfile: zod.ZodOptional<zod.ZodString>;
@@ -11149,6 +11169,7 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
11149
11169
  claudeVersion: z.ZodOptional<z.ZodString>;
11150
11170
  delay: z.ZodOptional<z.ZodString>;
11151
11171
  pause: z.ZodOptional<z.ZodBoolean>;
11172
+ explain: z.ZodOptional<z.ZodBoolean>;
11152
11173
  }, z.core.$strict>>;
11153
11174
  }, z.core.$strict>;
11154
11175
  }, z.core.$strict>;
@@ -11168,6 +11189,7 @@ declare const ConfigProfileSetInputSchema: z.ZodObject<{
11168
11189
  claudeVersion: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
11169
11190
  delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
11170
11191
  pause: z.ZodOptional<z.ZodBoolean>;
11192
+ explain: z.ZodOptional<z.ZodBoolean>;
11171
11193
  }, z.core.$strict>>;
11172
11194
  }, z.core.$strict>;
11173
11195
  declare const ConfigProfileSetOutputSchema: z.ZodObject<{
@@ -11274,6 +11296,7 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
11274
11296
  claudeVersion: z.ZodOptional<z.ZodString>;
11275
11297
  delay: z.ZodOptional<z.ZodString>;
11276
11298
  pause: z.ZodOptional<z.ZodBoolean>;
11299
+ explain: z.ZodOptional<z.ZodBoolean>;
11277
11300
  }, z.core.$strict>>;
11278
11301
  }, z.core.$strict>;
11279
11302
  }, z.core.$strict>;
@@ -11878,6 +11901,7 @@ declare const ConfigRuleAddOutputSchema: z.ZodObject<{
11878
11901
  claudeVersion: z.ZodOptional<z.ZodString>;
11879
11902
  delay: z.ZodOptional<z.ZodString>;
11880
11903
  pause: z.ZodOptional<z.ZodBoolean>;
11904
+ explain: z.ZodOptional<z.ZodBoolean>;
11881
11905
  }, z.core.$strict>>;
11882
11906
  path: z.ZodString;
11883
11907
  configProfile: z.ZodOptional<z.ZodString>;
@@ -12066,6 +12090,7 @@ declare const ConfigRuleSetOutputSchema: z.ZodObject<{
12066
12090
  claudeVersion: z.ZodOptional<z.ZodString>;
12067
12091
  delay: z.ZodOptional<z.ZodString>;
12068
12092
  pause: z.ZodOptional<z.ZodBoolean>;
12093
+ explain: z.ZodOptional<z.ZodBoolean>;
12069
12094
  }, z.core.$strict>>;
12070
12095
  path: z.ZodString;
12071
12096
  configProfile: z.ZodOptional<z.ZodString>;
@@ -12553,6 +12578,7 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
12553
12578
  headroom: z.ZodBoolean;
12554
12579
  trackUsage: z.ZodBoolean;
12555
12580
  pause: z.ZodBoolean;
12581
+ explain: z.ZodBoolean;
12556
12582
  delayMs: z.ZodNumber;
12557
12583
  }, z.core.$strict>;
12558
12584
  claudeVersion: z.ZodOptional<z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.29.0",
3
+ "version": "11.31.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>",