Task configuration:
{"task_id": "01", "task_name": "update_color_theme", "description": "\u5728Joplin\u4e2d\u4fee\u6539\u989c\u8272\u4e3b\u9898", "application_info": {"name": "joplin", "executable_path": "/workspace/PC-Canary/apps/joplin/Joplin-3.3.12.AppImage", "args": ["--env", "dev", "--profile", "/workspace/PC-Canary/apps/joplin/joplindev-desktop"]}, "task_parameters": {"theme": "Dark"}, "instruction_template": "\u5728Joplin\u4e2d\u4fee\u6539\u989c\u8272\u4e3b\u9898\u4e3a ${theme}", "evaluation_setup": {"scripts": [{"role": "hook", "path": "hooker.js"}, {"role": "handler", "path": "handler.py"}], "timeout": 10, "evaluator_type": "IpcInjector", "evaluate_on_completion": true}, "total_key_steps": 1, "preconditions": {"joplin_running": true}, "events": {"evaluate_on_completion": {"description": "\u5728\u4efb\u52a1\u7ed3\u675f\u65f6\u5224\u65ad\u4e3b\u9898\u989c\u8272\u662f\u5426\u7b26\u5408\u9884\u671f", "is_key_step": true, "key_step_index": 1, "key_step_name": "\u4e3b\u9898\u989c\u8272\u5df2\u7ecf\u8bbe\u7f6e\u6210\u529f"}}, "mcp_servers": [{"command": "/home/user/.local/bin/uv", "args": ["--directory", "/home/user/Desktop/joplin-mcp-server", "run", "src/mcp/joplin_mcp.py"]}]}

Hook script:
// 使用 Joplin 插件 API 来处理通信
joplin.plugins.register({
    onStart: async function() {
        console.log('Joplin plugin started');
        
        // 主题值映射
        const themeMap = {
            '1': 'Light',
            '2': 'Dark',
            '3': 'Sepia'
        };

        // 监听 evaluate 事件
        socket.on("evaluate", async () => {
            console.log('Task01_updateColorTheme---------------------------');
            try {
                // 获取当前主题
                const themeValue = await joplin.settings.globalValue('theme');
                const currentTheme = themeMap[themeValue] || 'Unknown';
                console.log('Current theme value:', themeValue, 'mapped to:', currentTheme);
                
                // 使用 postMessage 发送评估消息
                window.postMessage({
                    "event_type": "evaluate_on_completion",
                    "message": "任务结束时Joplin的主题颜色是" + currentTheme,
                    "data": currentTheme
                }, '*');
                console.log('Evaluation result sent via postMessage');
            } catch (error) {
                console.error('Error in evaluate handler:', error);
            }
        });
    }
}); 

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

"""
joplin修改主题颜色的事件处理器
负责处理钩子脚本产生的事件并更新评估指标
"""

from typing import Dict, Any, Optional, List

def message_handler(message: Dict[str, Any], logger, task_parameter: Dict[str, Any]) -> Optional[List[Dict[str, Any]]]:    
    event_type = message.get('event_type')
    logger.info(message.get('message'))
    
    # 打印完整的参数信息
    logger.info("="*50)
    logger.info("参数调试信息:")
    logger.info(f"task_parameter 类型: {type(task_parameter)}")
    logger.info(f"task_parameter 内容: {task_parameter}")
    logger.info("="*50)
    
    if event_type == "evaluate_on_completion":
        changed_theme = message.get("data")
        expected_theme = task_parameter.get('theme', "Light")
        
        logger.info(f"正在检测主题颜色是否为: {expected_theme}")
        logger.info(f"当前Joplin主题颜色为: {changed_theme}")
        
        if changed_theme == expected_theme:
            return [
                {"status": "key_step", "index": 1},
                {"status": "success", "reason": f"颜色主题已经成功设置成{expected_theme}"}
            ]
        else:
            return [{"status": "error", "type": "evaluate_on_completion", "message": f"主题颜色不匹配，期望：{expected_theme}，实际：{changed_theme}"}]
    return None