"use client";
import { useCallback } from "react";
import { useStigmer } from "../hooks";
import { useResourceCount } from "../search";
/**
 * Data hook that fetches the total count of agents.
 *
 * Issues a minimal `stigmer.agent.list()` call to retrieve only the
 * total count — no agent entries are returned or stored. Useful for
 * summary cards, badges, and dashboard widgets.
 *
 * For the full paginated agent list, use {@link useAgentList} instead.
 *
 * Pass `null` as `org` to skip fetching (stable no-op).
 *
 * @example
 * ```tsx
 * const { count, isLoading } = useAgentCount("acme");
 * ```
 *
 * @example
 * ```tsx
 * // Count all accessible agents including public/platform ones
 * const { count } = useAgentCount("acme", { scope: "all" });
 * ```
 */
export function useAgentCount(org, options) {
    const stigmer = useStigmer();
    const listFn = useCallback((params) => stigmer.agent.list(params), [stigmer]);
    return useResourceCount(listFn, org, options);
}
//# sourceMappingURL=useAgentCount.js.map