claude-use 11.30.0 → 11.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -34323,7 +34323,7 @@ var init_package = __esm({
34323
34323
  "package.json"() {
34324
34324
  package_default = {
34325
34325
  name: "claude-use",
34326
- version: "11.30.0",
34326
+ version: "11.31.1",
34327
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.",
34328
34328
  license: "MIT",
34329
34329
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -34936,7 +34936,7 @@ function destinationOf(path65, sessionProvider) {
34936
34936
  }
34937
34937
  function buildRecord(event, context) {
34938
34938
  const { scan } = context;
34939
- const { provider, endpoint } = destinationOf(event.path, event.session.provider);
34939
+ const { provider, endpoint } = destinationOf(event.servedPath, event.session.provider);
34940
34940
  const rateLimitHeaders = rateLimitHeadersOf(event.headers);
34941
34941
  const limit = classifyLimit({ status: event.status, headers: rateLimitHeaders ?? {}, error: scan?.error, nowMs: context.endedAt });
34942
34942
  const requestId = headerValue(event.headers, "request-id");
@@ -64257,6 +64257,9 @@ function resolveAntigravityConfig(config2) {
64257
64257
  const target = overrides[tier];
64258
64258
  return target === void 0 ? ANTIGRAVITY_DEFAULT_TIER_MODELS[tier] : candidatesOf(target);
64259
64259
  };
64260
+ if (!aliases.has(AUTO_ALIAS)) {
64261
+ aliases.set(AUTO_ALIAS, [...new Set(CLAUDE_TIERS.flatMap(tierModel))]);
64262
+ }
64260
64263
  return {
64261
64264
  mode: config2?.mode ?? ANTIGRAVITY_DEFAULT_MODE,
64262
64265
  defaultModel: config2?.defaultModel ?? ANTIGRAVITY_DEFAULT_MODEL,
@@ -64523,7 +64526,7 @@ function translateRequest(request7, config2, routing) {
64523
64526
  toolNames
64524
64527
  };
64525
64528
  }
64526
- 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;
64527
64530
  var init_translate = __esm({
64528
64531
  "src/antigravity/translate.ts"() {
64529
64532
  "use strict";
@@ -64532,6 +64535,7 @@ var init_translate = __esm({
64532
64535
  init_signatures();
64533
64536
  init_schema();
64534
64537
  init_anthropic();
64538
+ AUTO_ALIAS = "auto";
64535
64539
  CONTEXT_MARKER_1M = "[1m]";
64536
64540
  BACKEND_FAMILY_PREFIXES = ["gemini-", "antigravity-", "gpt-oss-"];
64537
64541
  BACKEND_CLAUDE_NAME = /^claude-.+-(?:low|medium|high|thinking)$/;
@@ -64881,9 +64885,10 @@ function antigravityRows(provider) {
64881
64885
  const aliases = [...config2.aliases].flatMap(([alias, candidates]) => {
64882
64886
  const [first] = candidates;
64883
64887
  const behavesAs = first === void 0 ? void 0 : behavesAsOf.get(first);
64884
- 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 }];
64885
64890
  });
64886
- return [...tiers, ...aliases];
64891
+ return [...aliases.filter((row) => row.model === AUTO_ALIAS), ...tiers, ...aliases.filter((row) => row.model !== AUTO_ALIAS)];
64887
64892
  }
64888
64893
  function codexRows(provider) {
64889
64894
  const config2 = resolveCodexConfig(provider.codex);
@@ -129163,7 +129168,7 @@ function createRoutedResponse(response, context) {
129163
129168
  start: (status, headers) => {
129164
129169
  for (const observe of deps.responseObservers) {
129165
129170
  try {
129166
- const body = observe({ session, route, method: request7.method, path: request7.path, receivedAt: request7.receivedAt, viaHeadroom: request7.viaHeadroom, lineage: request7.thread.lineage, status, headers });
129171
+ const body = observe({ session, route, method: request7.method, path: request7.path, servedPath: context.servedPath, receivedAt: request7.receivedAt, viaHeadroom: request7.viaHeadroom, lineage: request7.thread.lineage, status, headers });
129167
129172
  if (body !== void 0) {
129168
129173
  bodyObservers.push(body);
129169
129174
  }
@@ -129208,7 +129213,7 @@ async function serveRouted(request7, deps) {
129208
129213
  const identified = identifyRequest(request7.headers);
129209
129214
  const admission = deps.admit({ url: request7.url, headers: request7.headers, forwardable: identified.forwardableHeaders });
129210
129215
  if (!admission.ok) {
129211
- const response2 = createRoutedResponse(request7.response, { deps, session: identified.session, route: "(unauthorized)", request: observed });
129216
+ const response2 = createRoutedResponse(request7.response, { deps, session: identified.session, route: "(unauthorized)", request: observed, servedPath: observed.path });
129212
129217
  response2.start(HTTP_STATUS.unauthorized, { "Content-Type": "application/json" });
129213
129218
  await response2.write(errorBody(HTTP_STATUS.unauthorized, admission.message));
129214
129219
  response2.end();
@@ -129224,7 +129229,7 @@ async function serveRouted(request7, deps) {
129224
129229
  };
129225
129230
  const resolution = await deps.resolveRoute(routed);
129226
129231
  if (!resolution.ok) {
129227
- const response2 = createRoutedResponse(request7.response, { deps, session: identified.session, route: "(unrouted)", request: observed });
129232
+ const response2 = createRoutedResponse(request7.response, { deps, session: identified.session, route: "(unrouted)", request: observed, servedPath: observed.path });
129228
129233
  response2.start(resolution.status, { "Content-Type": "application/json" });
129229
129234
  await response2.write(errorBody(resolution.status, resolution.message));
129230
129235
  response2.end();
@@ -129233,10 +129238,10 @@ async function serveRouted(request7, deps) {
129233
129238
  const { headroom } = deps;
129234
129239
  const wantsHeadroom = headroom !== void 0 && await deps.headroomDecision.decide(identified.session.sessionId, identified.session.headroom, deps.now(), async () => await headroomReady(headroom, request7.signal));
129235
129240
  const viaHeadroom = wantsHeadroom && resolution.route.headroomEligible && deps.headroom !== void 0;
129236
- const response = createRoutedResponse(request7.response, { deps, session: identified.session, route: resolution.route.name, request: { ...observed, viaHeadroom } });
129241
+ const response = createRoutedResponse(request7.response, { deps, session: identified.session, route: resolution.route.name, request: { ...observed, viaHeadroom }, servedPath: pathOf(resolution.request?.url ?? request7.url) });
129237
129242
  try {
129238
129243
  if (viaHeadroom) {
129239
- await applyHeadroomHop(routed, response, resolution.route.headroomUpstream, deps.headroom, (lineage) => {
129244
+ await applyHeadroomHop(resolution.request ?? routed, response, resolution.route.headroomUpstream, deps.headroom, (lineage) => {
129240
129245
  observed.thread.lineage = lineage;
129241
129246
  });
129242
129247
  } else {
@@ -130231,7 +130236,7 @@ function exhaustedMessage(exhaustion) {
130231
130236
  }
130232
130237
  function createAntigravityRoute(ports) {
130233
130238
  const fallbackId = ports.fallbackId ?? (() => (0, import_node_crypto23.randomUUID)());
130234
- const lastRouted = /* @__PURE__ */ new Map();
130239
+ const lastRouted = ports.lastRouted ?? /* @__PURE__ */ new Map();
130235
130240
  return async (request7) => {
130236
130241
  await Promise.resolve();
130237
130242
  if (request7.method !== "POST") {
@@ -130609,10 +130614,6 @@ async function scanRequestHead(request7, wholeBody = false) {
130609
130614
  text2 += chunk2.toString("utf8");
130610
130615
  if (!wholeBody && (modelIn() !== void 0 || seen >= REQUEST_SCAN_CAP_BYTES)) {
130611
130616
  decided = true;
130612
- body.pause();
130613
- replay.once("resume", () => {
130614
- body.resume();
130615
- });
130616
130617
  settle2();
130617
130618
  }
130618
130619
  });
@@ -130653,6 +130654,16 @@ function scopeSessionProviderPath(request7) {
130653
130654
  function createProviderRouteResolver(deps) {
130654
130655
  const oauthRoute = createPassthroughRoute("anthropic", { baseUrl: `https://${CONNECT_INTERCEPT_HOST}:${String(HTTPS_PORT)}`, stripPrefix: void 0, headroomUpstream: void 0 });
130655
130656
  const antigravityQuotaSources = /* @__PURE__ */ new Map();
130657
+ const antigravityRoutingMemory = /* @__PURE__ */ new Map();
130658
+ const memoryFor = (provider) => {
130659
+ const existing = antigravityRoutingMemory.get(provider);
130660
+ if (existing !== void 0) {
130661
+ return existing;
130662
+ }
130663
+ const created = /* @__PURE__ */ new Map();
130664
+ antigravityRoutingMemory.set(provider, created);
130665
+ return created;
130666
+ };
130656
130667
  const antigravityQuotaOf = (provider, definition, config2) => {
130657
130668
  const existing = antigravityQuotaSources.get(provider);
130658
130669
  if (existing !== void 0) {
@@ -130744,7 +130755,8 @@ function createProviderRouteResolver(deps) {
130744
130755
  credentialTarget: antigravityProvider.credential.target
130745
130756
  };
130746
130757
  },
130747
- quotaSource: antigravityQuotaOf(provider, antigravityProvider, config2)
130758
+ quotaSource: antigravityQuotaOf(provider, antigravityProvider, config2),
130759
+ lastRouted: memoryFor(provider)
130748
130760
  },
130749
130761
  directOrigin2(deps.directPort()),
130750
130762
  provider
@@ -130798,7 +130810,7 @@ function createProviderRouteResolver(deps) {
130798
130810
  }
130799
130811
  if (routes === void 0 || routes.length === 0) {
130800
130812
  const resolution = resolve2(current);
130801
- return resolution.ok && replay !== void 0 ? { ok: true, route: servingRewritten(resolution.route, { ...replay, url: current.url }) } : resolution.ok ? serveScoped(resolution) : resolution;
130813
+ return resolution.ok && replay !== void 0 ? { ok: true, route: servingRewritten(resolution.route, { ...replay, url: current.url }), request: { ...replay, url: current.url } } : resolution.ok ? serveScoped(resolution) : resolution;
130802
130814
  }
130803
130815
  const whole = routes.some((entry) => entry.model !== void 0 || referencesFact(entry.when, "request.hasImage"));
130804
130816
  const snapshot = deps.usageSnapshotOf?.(current.session.identity);
@@ -130810,7 +130822,7 @@ function createProviderRouteResolver(deps) {
130810
130822
  const scan = await scanRequestHead(current, whole);
130811
130823
  if (scan.replayed === void 0) {
130812
130824
  const resolution = resolve2(current);
130813
- return resolution.ok && replay !== void 0 ? { ok: true, route: servingRewritten(resolution.route, { ...replay, url: current.url }) } : resolution.ok ? serveScoped(resolution) : resolution;
130825
+ return resolution.ok && replay !== void 0 ? { ok: true, route: servingRewritten(resolution.route, { ...replay, url: current.url }), request: { ...replay, url: current.url } } : resolution.ok ? serveScoped(resolution) : resolution;
130814
130826
  }
130815
130827
  replay = scan.replayed;
130816
130828
  const requestFacts = {
@@ -130832,7 +130844,7 @@ function createProviderRouteResolver(deps) {
130832
130844
  }
130833
130845
  if (matched === void 0) {
130834
130846
  const resolution = resolve2(current);
130835
- return resolution.ok ? { ok: true, route: servingRewritten(resolution.route, { ...replay, url: current.url }) } : resolution;
130847
+ return resolution.ok ? { ok: true, route: servingRewritten(resolution.route, { ...replay, url: current.url }), request: { ...replay, url: current.url } } : resolution;
130836
130848
  }
130837
130849
  if (matched.model !== void 0 && scan.text !== void 0 && scan.model !== void 0) {
130838
130850
  const rewritten = scan.text.replace(new RegExp('"model":\\s*"' + scan.model.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + '"'), '"model":"' + matched.model + '"');
package/dist/index.cjs CHANGED
@@ -2983,7 +2983,7 @@ var init_package = __esm({
2983
2983
  "package.json"() {
2984
2984
  package_default = {
2985
2985
  name: "claude-use",
2986
- version: "11.30.0",
2986
+ version: "11.31.1",
2987
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.",
2988
2988
  license: "MIT",
2989
2989
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -8295,6 +8295,9 @@ function resolveAntigravityConfig(config) {
8295
8295
  const target = overrides[tier];
8296
8296
  return target === void 0 ? ANTIGRAVITY_DEFAULT_TIER_MODELS[tier] : candidatesOf(target);
8297
8297
  };
8298
+ if (!aliases.has(AUTO_ALIAS)) {
8299
+ aliases.set(AUTO_ALIAS, [...new Set(CLAUDE_TIERS.flatMap(tierModel))]);
8300
+ }
8298
8301
  return {
8299
8302
  mode: config?.mode ?? ANTIGRAVITY_DEFAULT_MODE,
8300
8303
  defaultModel: config?.defaultModel ?? ANTIGRAVITY_DEFAULT_MODEL,
@@ -8313,6 +8316,7 @@ function resolveAntigravityConfig(config) {
8313
8316
  }
8314
8317
  };
8315
8318
  }
8319
+ var AUTO_ALIAS;
8316
8320
  var init_translate = __esm({
8317
8321
  "src/antigravity/translate.ts"() {
8318
8322
  "use strict";
@@ -8320,6 +8324,7 @@ var init_translate = __esm({
8320
8324
  init_signatures();
8321
8325
  init_schema();
8322
8326
  init_anthropic();
8327
+ AUTO_ALIAS = "auto";
8323
8328
  }
8324
8329
  });
8325
8330
 
@@ -8431,9 +8436,10 @@ function antigravityRows(provider) {
8431
8436
  const aliases = [...config.aliases].flatMap(([alias, candidates]) => {
8432
8437
  const [first] = candidates;
8433
8438
  const behavesAs = first === void 0 ? void 0 : behavesAsOf.get(first);
8434
- 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 }];
8435
8441
  });
8436
- return [...tiers, ...aliases];
8442
+ return [...aliases.filter((row) => row.model === AUTO_ALIAS), ...tiers, ...aliases.filter((row) => row.model !== AUTO_ALIAS)];
8437
8443
  }
8438
8444
  function codexRows(provider) {
8439
8445
  const config = resolveCodexConfig(provider.codex);
package/dist/index.mjs CHANGED
@@ -2959,7 +2959,7 @@ var init_package = __esm({
2959
2959
  "package.json"() {
2960
2960
  package_default = {
2961
2961
  name: "claude-use",
2962
- version: "11.30.0",
2962
+ version: "11.31.1",
2963
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.",
2964
2964
  license: "MIT",
2965
2965
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -8267,6 +8267,9 @@ function resolveAntigravityConfig(config) {
8267
8267
  const target = overrides[tier];
8268
8268
  return target === void 0 ? ANTIGRAVITY_DEFAULT_TIER_MODELS[tier] : candidatesOf(target);
8269
8269
  };
8270
+ if (!aliases.has(AUTO_ALIAS)) {
8271
+ aliases.set(AUTO_ALIAS, [...new Set(CLAUDE_TIERS.flatMap(tierModel))]);
8272
+ }
8270
8273
  return {
8271
8274
  mode: config?.mode ?? ANTIGRAVITY_DEFAULT_MODE,
8272
8275
  defaultModel: config?.defaultModel ?? ANTIGRAVITY_DEFAULT_MODEL,
@@ -8285,6 +8288,7 @@ function resolveAntigravityConfig(config) {
8285
8288
  }
8286
8289
  };
8287
8290
  }
8291
+ var AUTO_ALIAS;
8288
8292
  var init_translate = __esm({
8289
8293
  "src/antigravity/translate.ts"() {
8290
8294
  "use strict";
@@ -8292,6 +8296,7 @@ var init_translate = __esm({
8292
8296
  init_signatures();
8293
8297
  init_schema();
8294
8298
  init_anthropic();
8299
+ AUTO_ALIAS = "auto";
8295
8300
  }
8296
8301
  });
8297
8302
 
@@ -8403,9 +8408,10 @@ function antigravityRows(provider) {
8403
8408
  const aliases = [...config.aliases].flatMap(([alias, candidates]) => {
8404
8409
  const [first] = candidates;
8405
8410
  const behavesAs = first === void 0 ? void 0 : behavesAsOf.get(first);
8406
- 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 }];
8407
8413
  });
8408
- return [...tiers, ...aliases];
8414
+ return [...aliases.filter((row) => row.model === AUTO_ALIAS), ...tiers, ...aliases.filter((row) => row.model !== AUTO_ALIAS)];
8409
8415
  }
8410
8416
  function codexRows(provider) {
8411
8417
  const config = resolveCodexConfig(provider.codex);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.30.0",
3
+ "version": "11.31.1",
4
4
  "description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
5
5
  "license": "MIT",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",