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 • 703 B
import{K as e,v as t}from"./sdk-contracts.js";import{r as n}from"./hdc.js";async function r(r,i,a,o){if(i!==`clear-app-state`)throw new t(`UNSUPPORTED_OPERATION`,`HarmonyOS setting "${i}" is not supported`,{hint:`HarmonyOS currently supports settings clear-app-state for an app bundle only.`});if(a!==`clear`)throw new t(`INVALID_ARGS`,`settings clear-app-state only supports clear.`);if(!o)throw new t(`INVALID_ARGS`,`settings clear-app-state requires an app id or an active app session.`,e());return await n(r,[`aa`,`force-stop`,o],{timeoutMs:15e3}),await n(r,[`bm`,`clean`,`-n`,o,`-d`,`-c`],{timeoutMs:15e3}),{bundleId:o,forceStopped:!0,clearedData:!0,clearedCache:!0}}export{r as setHarmonySetting};