@cortexkit/anthropic-auth-core 2.16.2 → 2.16.3

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30303,22 +30303,23 @@ class StickySessionRouter {
30303
30303
  } while (pending !== this.publicationChain);
30304
30304
  }
30305
30305
  selectCandidate(input) {
30306
- let candidates = [...input.candidates];
30307
- if (input.family === "opus") {
30308
- const depleted = candidates.filter((candidate) => stickyRouteKnownFableExhausted(candidate, input.storage, this.now()));
30309
- if (depleted.length > 0)
30310
- candidates = depleted;
30311
- }
30312
- const weighted = candidates.flatMap((candidate) => {
30306
+ const { candidates } = input;
30307
+ const now = this.now();
30308
+ let weighted = candidates.flatMap((candidate) => {
30313
30309
  const weight = stickyRouteCandidateWeight({
30314
30310
  candidate,
30315
30311
  family: input.family,
30316
30312
  modelId: input.modelId,
30317
30313
  storage: input.storage,
30318
- now: this.now()
30314
+ now
30319
30315
  });
30320
30316
  return weight > 0 ? [{ candidate, weight }] : [];
30321
30317
  });
30318
+ if (input.family === "opus") {
30319
+ const depleted = weighted.filter(({ candidate }) => stickyRouteKnownFableExhausted(candidate, input.storage, now));
30320
+ if (depleted.length > 0)
30321
+ weighted = depleted;
30322
+ }
30322
30323
  if (weighted.length === 0 && candidates.every((candidate) => !knownQuota(candidate.quota))) {
30323
30324
  return [...candidates].sort((left, right) => left.order - right.order || left.accountId.localeCompare(right.accountId))[0];
30324
30325
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/anthropic-auth-core",
3
- "version": "2.16.2",
3
+ "version": "2.16.3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",