Task configuration:
{"task_id": "13", "task_name": "export_and_import_profile", "description": "obs-studio export profile and import profile", "application_info": {"name": "obs-studio", "executable_path": "/workspace/PC-Canary/apps/obs-studio/build_ubuntu/rundir/Debug/bin/obs", "args": []}, "task_parameters": {"profile_name": "agent", "export_path": "/tmp", "import_path": "/home/agent/agent-tmp-file/agent1"}, "instruction_template": "Please export the profile named ${profile_name} in obs to ${export_path}, then import the profile configuration file from ${import_path}", "evaluation_setup": {"scripts": [{"role": "hook", "path": "hooker.js"}, {"role": "handler", "path": "handler.py"}], "timeout": 180}, "preconditions": {"obs_studio_running": true}, "total_key_steps": 2, "events": {"export_success": {"description": "Export profile successful", "is_key_step": true, "key_step_index": 1, "key_step_name": "Export profile successful"}, "import_success": {"description": "Import profile successful", "is_key_step": true, "key_step_index": 2, "key_step_name": "Import profile successful"}}, "mcp_servers": [{"command": "node", "args": ["/home/agent/obs-mcp/build/index.js"]}], "context_data": [{"from": "tests/context_data/obs-studio/task13", "to": "/home/agent/agent-tmp-file"}]}

Hook script:
(function () {
    // Script settings
    const EVENT_ON_ENTER = "function called";
    const EVENT_ON_LEAVE = "function returned";

    const MESSAGE_called = "Intercepted function call";
    const MESSAGE_returned = "Function returned";
    const MESSAGE_script_initialized = "Monitoring script has started";
    const MESSAGE_hook_installed = "Monitoring hook installed, waiting for operation...";

    // Send events to the evaluation system
    function sendEvent(eventType, data = {}) {
        const payload = {
            event: eventType,
            ...data,
            timestamp: new Date().getTime()
        };
        send(payload);
    }

    // Get function address
    function getFunctionAddress(functionName) {
        const funcAddr = DebugSymbol.getFunctionByName(functionName);
        if (!funcAddr) {
            sendEvent("error", {
                error_type: "function_not_found",
                message: `Cannot find function ${functionName}`
            });
            return null;
        }

        sendEvent("function_found", {
            address: funcAddr.toString(),
            message: `Found the actual address of function ${functionName}`
        });
        return funcAddr;
    }

    // Initialize recording update hooks
    function hook() {
        let function_name = "OBSBasic::on_actionImportProfile_triggered";
        let symbol_name = "_ZN8OBSBasic32on_actionImportProfile_triggeredEv";
        Interceptor.attach(getFunctionAddress(symbol_name), {
            onEnter(args) {
                sendEvent(EVENT_ON_ENTER, {
                    message: MESSAGE_called,
                    function: function_name,
                    symbol: symbol_name
                });
            },

            onLeave(retval) {
                sendEvent(EVENT_ON_LEAVE, {
                    message: MESSAGE_returned,
                    function: function_name,
                    symbol: symbol_name
                });
                sendEvent("import_success", {
                    message: "Profile import completed",
                    import_success: "True"
                });
            }
        });

        function_name = "OBSBasic::on_actionExportProfile_triggered";
        symbol_name = "_ZN8OBSBasic32on_actionExportProfile_triggeredEv";
        Interceptor.attach(getFunctionAddress(symbol_name), {
            onEnter(args) {
                sendEvent(EVENT_ON_ENTER, {
                    message: MESSAGE_called,
                    function: function_name,
                    symbol: symbol_name
                });
            },

            onLeave(retval) {
                sendEvent(EVENT_ON_LEAVE, {
                    message: MESSAGE_returned,
                    function: function_name,
                    symbol: symbol_name
                });
                sendEvent("export_success", {
                    message: "Profile export completed",
                });
            }
        });
    }

    function init_getconfig() {
        Interceptor.attach(getFunctionAddress("os_get_config_path"), {
            onEnter(args){
                this.name = args[0];
            },
            onLeave(retval) {
                sendEvent("get_config_path", {
                    message: "Get configuration file path",
                    path: this.name.readCString()
                });
            }
        });
    }

    // Initialize hooks
    function initHook() {
        sendEvent("script_initialized", {
            message: MESSAGE_script_initialized
        });

        // Initialize individual hooks
        hook();
        init_getconfig();
        sendEvent("hook_installed", {
            message: MESSAGE_hook_installed
        });
    }

    // Start script
    initHook();
})();

Evaluation handler:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
from typing import Dict, Any, Optional, List

step = 0
config_path = ""


def message_handler(
    message: Dict[str, Any], logger, task_parameter: Dict[str, Any]
) -> Optional[List[Dict[str, Any]]]:
    global step, config_path
    print(message)
    payload = message["payload"]
    event_type = payload["event"]
    logger.debug(f"Received event: {event_type}")
    if event_type == "export_success":
        export_path = task_parameter.get("export_path", "")
        profile_name = task_parameter.get("profile_name", "")
        expected_path = os.path.join(export_path, profile_name)
        if os.path.exists(expected_path):
            step = 1
            return [
                {"status": "key_step", "index": 1},
            ]
        else:
            return [
                {
                    "status": "error",
                    "reason": "script_error",
                    "message": "Cannot find the corresponding configuration file",
                },
            ]

    elif event_type == "import_success":
        import_path = task_parameter.get("import_path", "")
        have_dir = os.path.exists(import_path)
        success = (
            True if payload.get("import_success", "") == "True" else False
        ) and have_dir
        found_import = False
        if config_path.endswith("/*"):
            config_path = config_path[:-2]
        print(config_path)
        if os.path.exists(config_path):
            if os.path.basename(import_path) in os.listdir(config_path):
                print(os.path.basename(import_path))
                print(os.listdir(config_path))
                found_import = True
            else:
                for root, dirs, files in os.walk(config_path):
                    if os.path.basename(import_path) in dirs:
                        found_import = True
                        break
        if success and step == 1 and found_import:
            return [
                {"status": "key_step", "index": 2},
                {
                    "status": "success",
                    "reason": "Successfully imported configuration file",
                },
            ]

    elif event_type == "get_config_path":
        config_path = payload.get("path", "")

    return None