UNPKG

agent-device

Version:

Open source device layer for AI coding agents: a CLI, MCP server, and typed Node.js API to control mobile, web, TV, and desktop apps on devices and simulators, locally or in the cloud.

1 lines • 1.25 kB
function e(){return Object.freeze({start:async(e,t,r)=>await n(e,[`aa`,`start`,`-b`,`com.huawei.hmos.screenrecorder`,`-a`,`com.huawei.hmos.screenrecorder.ServiceExtAbility`,`--ps`,`CustomizedFileName`,t],r),stop:async(e,t)=>await n(e,[`aa`,`start`,`-b`,`com.huawei.hmos.screenrecorder`,`-a`,`com.huawei.hmos.screenrecorder.ServiceExtAbility`],t),findMedia:async(e,t,r)=>(await n(e,[`mediatool`,`query`,t,`-u`],r)).stdout.match(/file:\/\/[^\s"']+/)?.[0],stageMedia:async(e,t,r)=>(await n(e,[`mediatool`,`recv`,t.mediaUri,t.remotePath],r)).exitCode===0,stagedFileSize:async(e,t,r)=>{let i=await n(e,[`stat`,`-c`,`%s`,t],r);if(i.exitCode!==0)return;let a=Number(i.stdout.trim());return Number.isSafeInteger(a)&&a>0?a:void 0},pull:async(e,n,r)=>await t(e,[`file`,`recv`,n.remotePath,n.outputPath],r),remove:async(e,t,r)=>(await n(e,[`rm`,`-f`,t],r)).exitCode===0,removeMedia:async(e,t,r)=>(await n(e,[`mediatool`,`delete`,t],r)).exitCode===0})}async function t(e,t,n){let{runHarmonyHdc:r}=await import(`./src11.js`).then(e=>e.b);return await r(e,t,{allowFailure:!0,signal:n})}async function n(e,t,n){let{runHarmonyShell:r}=await import(`./src11.js`).then(e=>e.b);return await r(e,t,{allowFailure:!0,signal:n})}export{e as createHarmonyScreenRecordingHost};