/**
 * Shared utility for searching Actors via `GET /v2/store`.
 *
 * `GET /v2/store` returns only `[FREE, PAY_PER_EVENT]` Actors by default
 * (apify-core's `AGENT_SAFE_PRICING_MODELS`) and additionally drops Actors
 * that fail safety checks (KYC, full-permission low-usage, etc.) — so no
 * MCP-side rental over-fetch / filter is needed.
 */

!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fa7204c0-c2b6-5aeb-93a0-18dc2180cecf")}catch(e){}}();
import { ApifyClient } from '../apify_client.js';
export async function searchActorsByKeywords(options) {
    const { search, apifyToken, limit, offset, allowsAgenticUsers, includeInputSchema } = options;
    const client = new ApifyClient({ token: apifyToken });
    const storeClient = client.store();
    if (allowsAgenticUsers !== undefined)
        storeClient.params = { ...storeClient.params, allowsAgenticUsers };
    if (includeInputSchema !== undefined)
        storeClient.params = { ...storeClient.params, includeInputSchema };
    const results = await storeClient.list({ search, limit, offset });
    return results.items;
}
/**
 * Preset around `searchActorsByKeywords` for the agent-facing search tool:
 * always sets `includeInputSchema=true` and forwards `allowsAgenticUsers`
 * when a `paymentProvider` is in play. The public arg schema caps `limit`
 * at apify-core's hard cap (`MAX_LIMIT_WITH_INPUT_SCHEMA`).
 */
export async function searchAgentSafeActors(options) {
    const { keywords, apifyToken, limit, offset, paymentProvider } = options;
    return searchActorsByKeywords({
        search: keywords,
        apifyToken,
        limit,
        offset,
        allowsAgenticUsers: paymentProvider ? true : undefined,
        includeInputSchema: true,
    });
}
//# sourceMappingURL=actor_search.js.map
//# debugId=fa7204c0-c2b6-5aeb-93a0-18dc2180cecf
