
!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]="ecce1a71-7eba-560e-b26a-ef5a3212b868")}catch(e){}}();
import log from '@apify/log';
import { buildStartAsyncResponse } from '../core/call_actor_common.js';
/**
 * Apps-mode actor executor.
 * Runs actors asynchronously — starts the run and returns immediately with widget metadata.
 * The widget automatically tracks progress and updates the UI.
 */
export const appsActorExecutor = {
    async executeActorTool(params) {
        var _a;
        if ((_a = params.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
            return null;
        }
        const actorClient = params.apifyClient.actor(params.actorFullName);
        const actorRun = await actorClient.start(params.input, params.callOptions);
        log.debug('Started Actor run (async, direct actor tool)', {
            actorName: params.actorFullName,
            runId: actorRun.id,
            mcpSessionId: params.mcpSessionId,
        });
        return buildStartAsyncResponse({
            actorName: params.actorFullName,
            actorRun,
            input: params.input,
            widget: true,
        });
    },
};
//# sourceMappingURL=actor_executor.js.map
//# debugId=ecce1a71-7eba-560e-b26a-ef5a3212b868
