实践教程 本文说明Aluse云电脑中SDK接入的完整示例。 完整示例 plaintext import Client from '@ctyun/desktopagentsdk'; async function main() { // 创建 Client 实例 const client new Client({ apiKey: 'yourapikey', apiSecret: 'yourapisecret', desktopCode: 'yourdesktopcode' }); let sessionnull; try { // 创建会话 session await client.createSession(); console.log('会话创建成功:', session.sessionId); // 移动鼠标并点击 await session.computer.movemouse({x:500, y:300}); await session.computer.clickmouse({x:500, y:300}); // 输入文本 await session.computer.typetext({text:'Hello from Desktop Agent SDK!'}); // 截图 await session.computer.screenshot(); } catch (error) { console.error('操作失败:', error); } finally { // 关闭会话 await session.close(); } } main();