Task configuration:
{"task_id": "08", "task_name": "change_font_size", "description": "\u8c03\u6574Zotero\u5b57\u4f53\uff0c\u4f7f\u5b57\u4f53\u53d8\u5927", "application_info": {"type": "electron", "name": "zotero", "executable_path": "apps/zotero/app/scripts/build_and_run", "args": ["-r"]}, "task_parameters": {}, "instruction_template": "\u8c03\u6574\u5df2\u7ecf\u6253\u5f00\u7684Zotero\u5ba2\u6237\u7aef\u5b57\u4f53\uff0c\u4f7f\u5b57\u4f53\u53d8\u5927", "evaluation_setup": {"scripts": [{"role": "hook", "path": "hooker.js"}, {"role": "handler", "path": "handler.py"}], "timeout": 120, "evaluator_type": "IpcInjector", "evaluate_on_completion": true}, "total_key_steps": 1, "events": {"font_size_changed": {"description": "\u6210\u529f\u8c03\u6574\u5b57\u4f53", "is_key_step": true, "key_step_index": 1, "key_step_name": "\u6210\u529f\u8c03\u6574\u5b57\u4f53"}}, "mcp_servers": [{"cwd": "/home/agent/zotero-mcp", "command": "uv", "args": ["run", "zotero-mcp"], "env": {"ZOTERO_LOCAL": "true"}}], "pre_process": {"command": "python", "args": ["/home/agent/agent-demo/PC-Canary/tests/tasks/zotero/task08_change_font_size/pre_process.py"]}, "context_data": [{"from": "tests/context_data/zotero/task08_change_font_size/Zotero", "to": "/home/agent/Zotero"}, {"from": "tests/context_data/zotero/task08_change_font_size/.zotero", "to": "/home/agent/.zotero"}]}

Hook script:
// // hookClient.js
// const http = require('http');
// const { URL } = require('url');

// // 基础配置
// const SERVER_HOST = 'localhost';
// const SERVER_PORT = 5001;

// function sendRequest(path, params = {}) {
//     return new Promise((resolve, reject) => {
//         const url = new URL(`http://${SERVER_HOST}:${SERVER_PORT}/${path}`);
//         Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));

//         http.get(url, (res) => {
//             let data = '';
//             res.on('data', chunk => data += chunk);
//             res.on('end', () => resolve(JSON.parse(data)));
//         }).on('error', reject);
//     });
// }

// // 启用 Hook
// async function enableHook(hookName) {
//     return sendRequest(`call/${hookName}`);
// }

// // 禁用 Hook
// async function disableHook(hookName) {
//     return sendRequest(`stop/${hookName}`);
// }

// // 使用示例
// (async () => {
//     try {
//         // 启用 hookAddCollection
//         const enableResult = await enableHook('hookChangeFontSize');
//         console.log('启用结果:', enableResult);
//     } catch (err) {
//         console.error('操作失败:', err);
//     }
// })();

Evaluation handler:
import os
import json
import time
from typing import Dict, Any, Optional, List

def message_handler(message: Dict[str, Any], logger: Any, task_parameter: Dict[str, Any]) -> Optional[List[Dict[str, Any]]]:
    event_type = message.get('event_type')
    if event_type == 'font_size_changed_bigger':
        if check_font_size_increased(message):
            return [
                {"status": "key_step", "index": 1},
                {"status": "success", "reason": "字体大小已成功增加"}
            ]
        else:
            return None
    else:
        return [
            {"status": "error", "type": "evaluate_on_completion", "message": "任务没有完成"}
        ]


def check_font_size_increased(event_data):
    """
    检查事件是否为 Zotero 字体大小增加的事件
    
    参数:
        event_data (dict): 包含 pref, oldValue, newValue 等字段的事件数据
        
    返回:
        bool: 如果是字体大小增加，则返回 True；否则返回 False
    """
    # 检查参数
    if not isinstance(event_data, dict):
        print("错误: 事件数据不是字典类型")
        return False
        
    pref = event_data.get('pref')
    old_value = event_data.get('oldValue')
    new_value = event_data.get('newValue')
    
    if pref is None or old_value is None or new_value is None:
        print("错误: 事件数据缺少必要字段")
        return False
    
    # 检查是否是 Zotero 字体大小设置
    if pref != "extensions.zotero.fontSize":
        print(f"首选项 '{pref}' 不是 Zotero 字体大小设置")
        return False
    
    # 尝试将值转换为浮点数进行比较
    try:
        # 字体大小通常存储为字符串
        old_size = float(old_value)
        new_size = float(new_value)
        
        if new_size > old_size:
            print(f"Zotero 字体大小增加了: {old_size} -> {new_size}")
            return True
        else:
            print(f"Zotero 字体大小未增加: {old_size} -> {new_size}")
            return False
            
    except (ValueError, TypeError) as e:
        print(f"无法比较字体大小值: {old_value} 和 {new_value}, 错误: {e}")
        return False