/**
 * 飞书机器人与人才测评集成测试脚本
 * 用于验证命令解析和会话管理功能
 */

const AssessmentCommandParser = require('./server/src/feishu/services/assessment-command.parser').AssessmentCommandParser;

// 创建命令解析器实例
const parser = new AssessmentCommandParser();

// 测试命令解析
console.log('=== 测试命令解析 ===');

const testCommands = [
    '/assessment start',
    '/assessment start kb_xxx',
    '/assessment start tmpl_xxx',
    '/assessment answer 这是我的答案',
    '/assessment status',
    '/assessment result',
    '/assessment help',
    '/assessment cancel',
    '/测评 开始',
    '/测评回答 我的答案',
    '普通聊天消息',
];

testCommands.forEach(cmd => {
    const result = parser.parse(cmd);
    console.log(`命令: "${cmd}"`);
    console.log(`结果:`, result ? `${result.type} (${result.parameters.join(', ')})` : '非测评命令');
    console.log('---');
});

// 测试命令识别
console.log('\n=== 测试命令识别 ===');
testCommands.forEach(cmd => {
    const isCommand = parser.isAssessmentCommand(cmd);
    console.log(`"${cmd}" -> ${isCommand ? '测评命令' : '普通消息'}`);
});

console.log('\n=== 测试完成 ===');
