function formatStatus(bag) {
  const lines = [];
  lines.push(`wigolo v${bag.version}`);
  switch (bag.searxng) {
    case "ready":
      lines.push("\u2713 Search engine ready (not running \u2014 starts on demand)");
      break;
    case "failed":
      lines.push("\u2717 Search engine: failed (see `wigolo doctor`)");
      break;
    case "pending":
      lines.push("\u2298 Search engine: not installed (run `wigolo warmup`)");
      break;
  }
  lines.push(line("ML reranker", bag.reranker));
  lines.push(line("Embeddings", bag.embeddings));
  lines.push(`  Cache: ${bag.cache.pages} pages, ${formatBytes(bag.cache.bytes)}`);
  lines.push("");
  lines.push("Connected agents:");
  const connected = bag.agents.filter((a) => a.configured);
  if (connected.length === 0) {
    lines.push("  (none)");
  } else {
    for (const a of connected) lines.push(`  \u2713 ${a.displayName}`);
  }
  return lines.join("\n") + "\n";
}
function line(label, state) {
  if (state === "ok") return `\u2713 ${label} installed`;
  return `\u2298 ${label} not installed`;
}
function formatBytes(bytes) {
  if (bytes < 1024) return `${bytes} B`;
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
  if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
  return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
}
export {
  formatStatus
};
//# sourceMappingURL=status-format.js.map