@adhdev/daemon-standalone 1.0.49-rc.10 → 1.0.49-rc.11

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.js CHANGED
@@ -37056,10 +37056,10 @@ var require_dist3 = __commonJS({
37056
37056
  }
37057
37057
  function getDaemonBuildInfo() {
37058
37058
  if (cached2) return cached2;
37059
- const commit = readInjected(true ? "85491e20f327dc51eb20e6b0674af0041e0c5f5e" : void 0) ?? "unknown";
37060
- const commitShort = readInjected(true ? "85491e20" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
37061
- const version2 = readInjected(true ? "1.0.49-rc.10" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
37062
- const builtAt = readInjected(true ? "2026-08-14T23:22:28.218Z" : void 0);
37059
+ const commit = readInjected(true ? "a21460656698fe5b5567132109fe159f8ae2c56b" : void 0) ?? "unknown";
37060
+ const commitShort = readInjected(true ? "a2146065" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
37061
+ const version2 = readInjected(true ? "1.0.49-rc.11" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
37062
+ const builtAt = readInjected(true ? "2026-08-15T02:43:45.229Z" : void 0);
37063
37063
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
37064
37064
  return cached2;
37065
37065
  }
@@ -40501,6 +40501,13 @@ child.on('exit', () => process.exit(0));
40501
40501
  if (typeof retryAtMs !== "number" || retryAtMs > now) return false;
40502
40502
  return (failureRetries.get(provider)?.failures ?? 0) <= QUOTA_FAILURE_MAX_RETRIES;
40503
40503
  }
40504
+ function isSnapshotStaleForRouting(provider, now = Date.now()) {
40505
+ const entry = cache.get(provider);
40506
+ if (!entry) return false;
40507
+ const updatedAt = Number(entry.updatedAt);
40508
+ if (!Number.isFinite(updatedAt) || updatedAt <= 0) return true;
40509
+ return now - updatedAt >= QUOTA_ROUTABLE_MAX_AGE_MS;
40510
+ }
40504
40511
  function updateFailureRetry(provider, fetch2, isEnabled) {
40505
40512
  const entry = cache.get(provider);
40506
40513
  const retryAtMs = entry && entry.status !== "ok" ? entry.metadata?.retryAtMs : void 0;
@@ -40551,7 +40558,7 @@ child.on('exit', () => process.exit(0));
40551
40558
  } catch {
40552
40559
  active = false;
40553
40560
  }
40554
- const needsBackfill = options.isEnabled ? fetchers.some(({ provider }) => options.isEnabled(provider) && (!cache.has(provider) || isFailureRetryDue(provider))) : false;
40561
+ const needsBackfill = options.isEnabled ? fetchers.some(({ provider }) => options.isEnabled(provider) && (!cache.has(provider) || isFailureRetryDue(provider) || isSnapshotStaleForRouting(provider))) : false;
40555
40562
  if (!active && !needsBackfill) return;
40556
40563
  running = true;
40557
40564
  void refreshQuotaCacheOnce(fetchers, options.isEnabled).catch((e) => LOG2.warn("Quota", `Quota refresh tick error: ${e?.message || e}`)).finally(() => {
@@ -40613,6 +40620,7 @@ child.on('exit', () => process.exit(0));
40613
40620
  var hydrated;
40614
40621
  var QUOTA_FAILURE_MAX_RETRIES;
40615
40622
  var failureRetries;
40623
+ var QUOTA_ROUTABLE_MAX_AGE_MS;
40616
40624
  var WORKING_STATUSES;
40617
40625
  var bootRefreshInFlight;
40618
40626
  var QUOTA_EVENT_REFRESH_DEBOUNCE_MS;
@@ -40639,6 +40647,7 @@ child.on('exit', () => process.exit(0));
40639
40647
  hydrated = false;
40640
40648
  QUOTA_FAILURE_MAX_RETRIES = 4;
40641
40649
  failureRetries = /* @__PURE__ */ new Map();
40650
+ QUOTA_ROUTABLE_MAX_AGE_MS = 30 * 60 * 1e3;
40642
40651
  WORKING_STATUSES = /* @__PURE__ */ new Set([
40643
40652
  "generating",
40644
40653
  "waiting_approval",