@routstr/sdk 0.2.0 → 0.2.2

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
@@ -2338,6 +2338,12 @@ var ProviderManager = class {
2338
2338
  hasFailed(baseUrl) {
2339
2339
  return this.failedProviders.has(baseUrl);
2340
2340
  }
2341
+ /**
2342
+ * Get a copy of the failed providers set
2343
+ */
2344
+ getFailedProviders() {
2345
+ return new Set(this.failedProviders);
2346
+ }
2341
2347
  /**
2342
2348
  * Find the next best provider for a model
2343
2349
  * @param modelId The model ID to find a provider for
@@ -3207,7 +3213,7 @@ var RoutstrClient = class {
3207
3213
  retryCount: 0
3208
3214
  });
3209
3215
  }
3210
- throw new FailoverError(baseUrl, Array.from(this.providerManager));
3216
+ throw new FailoverError(baseUrl, Array.from(this.providerManager.getFailedProviders()));
3211
3217
  }
3212
3218
  /**
3213
3219
  * Handle post-response balance update for all modes
@@ -4001,7 +4007,6 @@ var createEmptyStore = (driver) => createStore((set, get) => ({
4001
4007
  const updates = typeof value === "function" ? value(state.clientIds) : value;
4002
4008
  const normalized = updates.map((entry) => ({
4003
4009
  ...entry,
4004
- baseUrl: normalizeBaseUrl(entry.baseUrl),
4005
4010
  createdAt: entry.createdAt ?? Date.now(),
4006
4011
  lastUsed: entry.lastUsed ?? null
4007
4012
  }));
@@ -4120,7 +4125,6 @@ var hydrateStoreFromDriver = async (store, driver) => {
4120
4125
  const usageTracking = rawUsageTracking;
4121
4126
  const clientIds = rawClientIds.map((entry) => ({
4122
4127
  ...entry,
4123
- baseUrl: normalizeBaseUrl(entry.baseUrl),
4124
4128
  createdAt: entry.createdAt ?? Date.now(),
4125
4129
  lastUsed: entry.lastUsed ?? null
4126
4130
  }));