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 • 935 B
JavaScript
import{j as e}from"./sdk-contracts.js";import{St as t}from"./sdk-io.js";import"./diagnostics.js";import{o as n,t as r}from"./artifact-tracking.js";import{i}from"./session-tenant-scope.js";import{a,o}from"./record-runtime-response.js";import s from"node:fs";function c(s,c,u){let d=s.session.lease;if(!d||!a(c,u))return;let f=i(d.tenantId,s.address),p=o(c).filter(e=>typeof e.path==`string`),m=[];try{for(let e of p)m.push(n({artifactPath:e.path,tenantId:d.tenantId,artifactType:e.artifactType,fileName:e.fileName,sessionName:f}))}catch(n){for(let e of m)r(e);for(let e of p)l(e.path);t({level:`warn`,phase:`leased_session_recording_retention_failed`,data:{session:s.address,leaseId:d.leaseId,error:e(n)}});return}t({level:`info`,phase:`leased_session_recording_retained`,data:{session:s.address,sessionName:f,leaseId:d.leaseId,artifactIds:m}})}function l(e){try{s.rmSync(e,{force:!0})}catch{}}export{c as retainLeasedSessionRecording};