
!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]="12a648c3-255c-5b04-8430-f01700f4e17b")}catch(e){}}();
import { logHttpError } from '../../utils/logging.js';
import { buildGetActorRunError, buildGetActorRunSuccessResponse, fetchActorRunData, getActorRunArgs, getActorRunMetadata, } from '../core/get_actor_run_common.js';
/**
 * Default mode get-actor-run tool.
 * Returns full JSON dump of the run without widget metadata.
 */
export const defaultGetActorRun = Object.freeze({
    ...getActorRunMetadata,
    call: async (toolArgs) => {
        const { args, apifyClient: client, mcpSessionId } = toolArgs;
        const parsed = getActorRunArgs.parse(args);
        try {
            const fetchResult = await fetchActorRunData({
                runId: parsed.runId,
                client,
                mcpSessionId,
            });
            if ('error' in fetchResult) {
                return fetchResult.error;
            }
            return buildGetActorRunSuccessResponse({ ...fetchResult.result, widget: false });
        }
        catch (error) {
            logHttpError(error, 'Failed to get Actor run', { runId: parsed.runId });
            return buildGetActorRunError(parsed.runId, error);
        }
    },
});
//# sourceMappingURL=get_actor_run.js.map
//# debugId=12a648c3-255c-5b04-8430-f01700f4e17b
