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.

3 lines • 1.23 kB
import{v as e}from"./sdk-contracts.js";import{h as t}from"./file.js";import{t as n}from"./command-policy.js";import{n as r}from"./shared.js";const i=async({positionals:i,flags:s,host:c})=>{if(i[0]!==`contact-sheet`)return!1;if(i.length>2)throw new e(`INVALID_ARGS`,`record contact-sheet accepts one recording path: record contact-sheet <video.mp4> [--out <sheet.png>]`);let l=t(a(i[1]),{cwd:c.cwd}),u=typeof s.out==`string`?t(s.out,{cwd:c.cwd}):void 0,[{executeRecordingContactSheet:d},{createLocalArtifactAdapter:f}]=await Promise.all([import(`./src9.js`),import(`./sdk-io.js`).then(e=>e.n)]),p=await d({backend:{platform:`ios`},artifacts:f({cwd:c.cwd}),sessions:{get:e=>({name:e}),set:()=>{}},policy:n()},{host:c,video:{kind:`path`,path:l},...u?{out:{kind:`path`,path:u}}:{}});return await r(s,p,()=>o(p)),!0};function a(t){if(t)return t;throw new e(`INVALID_ARGS`,`record contact-sheet requires a recording path: record contact-sheet <video.mp4>`)}function o(e){let t=(e.durationMs/1e3).toFixed(e.durationMs%1e3==0?0:1),n=[e.path,`${e.cells.length} cells over ${t}s (${e.sampledFrameCount} sample times, ${e.decodedFrameCount} frames decoded)`];return e.warning?[...n,e.warning].join(` `):n.join(` `)}export{i as recordingCommand};