class BackendStatus {
  _active = false;
  _reason;
  _warned = false;
  _bootstrapping = false;
  get isActive() {
    return this._active;
  }
  markUnhealthy(reason) {
    this._active = false;
    this._reason = reason;
    this._warned = false;
    this._bootstrapping = false;
  }
  markBootstrapping() {
    this._active = false;
    this._reason = "bootstrap in progress";
    this._warned = false;
    this._bootstrapping = true;
  }
  markHealthy() {
    this._active = true;
    this._reason = void 0;
    this._warned = false;
    this._bootstrapping = false;
  }
  /** Returns warning text once per fallback session, then undefined. */
  consumeWarning() {
    if (this._active || this._warned) return void 0;
    this._warned = true;
    if (this._bootstrapping) {
      return `Search engine is still starting up. Results may be lower quality until setup finishes. For best results, run: \`npx @staticn0va/wigolo warmup --all\` before connecting your agent.`;
    }
    return `Multi-engine search is unavailable; using fallback engines (lower quality). Reason: ${this._reason ?? "unknown"}. To retry: \`npx @staticn0va/wigolo warmup --force\`. For details: \`npx @staticn0va/wigolo doctor\`.`;
  }
}
export {
  BackendStatus
};
//# sourceMappingURL=backend-status.js.map