"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.recordEchoExecutor = void 0;
const EchoStep_1 = __importDefault(require("../../sharedUtils/mablscript/canonical/EchoStep"));
const mablscript_step_types_1 = require("../../sharedUtils/mablscript-step-types");
exports.recordEchoExecutor = {
    needsFind: () => false,
    getStepType: () => mablscript_step_types_1.StepType.ECHO,
    execute: async (payload, _stateProvider, eventHandler, logger) => {
        const toolParams = payload.toolCall.toolParams;
        const message = toolParams?.message;
        if (!message) {
            logger.error('Record echo executor requires a message');
            return {
                success: false,
                errorMessage: 'message is required for execute_echo',
            };
        }
        const echoStep = new EchoStep_1.default(`[TODO] ${message}`);
        await eventHandler.dispatchSteps([echoStep]);
        return { success: true };
    },
};
