import { resolveApiClient } from "../../internal/index.js";
/** Resolve the API client + org and fetch the org's agents. */
export async function fetchAgents(options = {}) {
    const { client, orgSlug, apiBaseUrl } = await resolveApiClient(options);
    const data = await client.get(`/api/${orgSlug}/agents`);
    return { agents: data.agents ?? [], orgSlug, apiBaseUrl };
}
/** The `connections:X active:Y clients:Z` counts fragment shared by both views. */
export function agentCountsText(agent) {
    return `connections:${agent.connectionCount ?? 0} active:${agent.activeConnectionCount ?? 0} clients:${agent.clientCount ?? 0}`;
}
//# sourceMappingURL=agents-view.js.map