接入指南 创建会话 plaintext const session await client.createSession(); console.log('sessionId:', session.sessionId); 会话对象包含: 属性 说明 sessionId 会话唯一标识 computer Computer Use 方法集合 filesystem FileSystem 方法集合 close 关闭会话方法 调用 Computer Use plaintext await session.computer.movemouse({ x: 500, y: 300 }); await session.computer.clickmouse({ x: 500, y: 300, clickMode: 'left' }); await session.computer.typetext({ text: 'Hello from AIuse' }); const screenshot await session.computer.screenshot(); 调用 FileSystem plaintext await session.filesystem.createdirectory({ path: 'C:/aiusertest' }); await session.filesystem.writefile({ path: 'C:/aiusertest/hello.txt', content: 'Hello from AIuse SDK', mode: 'overwrite' }); const result await session.filesystem.readfile({ path: 'C:/aiusertest/hello.txt', offset: 0, length: 0 }); console.log(result.data); 关闭会话 任务完成后应主动关闭会话: plaintext await session.close(); 推荐在 finally 中关闭: plaintext let session; try { session await client.createSession(); await session.computer.screenshot(); } finally { if (session) { await session.close(); } } 安全建议 AccessKey Secret 只应保存在服务端或可信密钥管理系统中。 日志中不要输出完整 AccessKey Secret。 每个项目或环境建议使用独立 AccessKey。 AccessKey 应只关联必要的云电脑资源。