agent-device 0.17.1 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.17.1.apk → agent-device-android-multitouch-helper-0.17.3.apk} +0 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.17.3.apk.sha256 +1 -0
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.17.1.manifest.json → agent-device-android-multitouch-helper-0.17.3.manifest.json} +4 -4
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.17.1.apk → agent-device-android-snapshot-helper-0.17.3.apk} +0 -0
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.17.3.apk.sha256 +1 -0
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.17.1.manifest.json → agent-device-android-snapshot-helper-0.17.3.manifest.json} +6 -6
- package/dist/src/123.js +1 -0
- package/dist/src/1231.js +1 -1
- package/dist/src/1352.js +1 -1
- package/dist/src/221.js +2 -2
- package/dist/src/2403.js +3 -0
- package/dist/src/2415.js +36 -30
- package/dist/src/4778.js +1 -1
- package/dist/src/5611.js +1 -0
- package/dist/src/5827.js +1 -0
- package/dist/src/6088.js +1 -0
- package/dist/src/6133.js +1 -0
- package/dist/src/7556.js +1 -1
- package/dist/src/7847.js +1 -1
- package/dist/src/8806.js +3 -3
- package/dist/src/9010.js +1 -0
- package/dist/src/9238.js +3 -3
- package/dist/src/9471.js +1 -1
- package/dist/src/9542.js +6 -3
- package/dist/src/9616.js +2 -0
- package/dist/src/9818.js +1 -1
- package/dist/src/android-adb.d.ts +12 -6
- package/dist/src/android-adb.js +1 -1
- package/dist/src/android-snapshot-helper.d.ts +15 -8
- package/dist/src/android.js +5 -5
- package/dist/src/apple.js +1 -1
- package/dist/src/apps.js +10 -10
- package/dist/src/args.js +53 -14
- package/dist/src/batch.d.ts +16 -4
- package/dist/src/batch.js +1 -1
- package/dist/src/cli-output.js +29 -0
- package/dist/src/cli.js +17 -42
- package/dist/src/command-surface.js +1 -1
- package/dist/src/contracts.d.ts +80 -4
- package/dist/src/contracts.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.d.ts +3 -1
- package/dist/src/generic.js +7 -7
- package/dist/src/index.d.ts +250 -79
- package/dist/src/index.js +1 -1
- package/dist/src/input-actions.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/internal/png-worker.d.ts +26 -0
- package/dist/src/internal/png-worker.js +1 -0
- package/dist/src/metro.d.ts +3 -1
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-trace-recording.js +3 -3
- package/dist/src/remote-config.d.ts +33 -7
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.d.ts +17 -3
- package/dist/src/selectors.js +1 -1
- package/dist/src/server.js +2 -2
- package/dist/src/session.js +8 -11
- package/dist/src/snapshot.js +2 -2
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/AgentDeviceRunnerUITests-Bridging-Header.h +1 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.h +14 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +297 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +328 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +121 -172
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +153 -5
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+FlatSnapshotFiltering.swift +171 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +0 -10
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +64 -18
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +200 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +406 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +82 -169
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +425 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +77 -6
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +10 -1
- package/ios-runner/README.md +5 -5
- package/ios-runner/RUNNER_PROTOCOL.md +0 -1
- package/package.json +8 -5
- package/server.json +2 -2
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.17.1.apk.sha256 +0 -1
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.17.1.apk.sha256 +0 -1
- package/dist/src/1998.js +0 -1
- package/dist/src/2805.js +0 -1
- package/dist/src/4057.js +0 -1
- package/dist/src/5310.js +0 -1
- package/dist/src/5792.js +0 -1
- package/dist/src/6085.js +0 -1
- package/dist/src/6232.js +0 -1
- package/dist/src/7455.js +0 -1
- package/dist/src/8020.js +0 -1
- package/dist/src/8502.js +0 -1
- package/dist/src/8699.js +0 -1
- package/dist/src/940.js +0 -1
- package/dist/src/9404.js +0 -1
- package/dist/src/9533.js +0 -1
- package/dist/src/command-metadata.js +0 -1
- /package/dist/src/{1393.js → 3675.js} +0 -0
package/dist/src/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{listMcpCommandMetadata as r,isCommandName as
|
|
2
|
-
`)}export{
|
|
1
|
+
import{formatCliOutput as t}from"./cli-output.js";import{listMcpCommandMetadata as r,isCommandName as e}from"./5611.js";import{readVersion as n}from"./9671.js";let i=function(r={}){return{execute:async(n,i)=>{var u;if(!e(n))throw Error(`Unknown command tool: ${n}`);let c=!(u=i)||"object"!=typeof u||Array.isArray(u)?{client:{},outputFormat:"optimized"}:{client:function(t){let r=t.stateDir,e={};if(void 0!==r&&("string"!=typeof r||0===r.length))throw Error("Expected stateDir to be a non-empty string.");return"string"==typeof r&&(e.stateDir=r),e}(u),outputFormat:function(t){if(void 0===t)return"optimized";if("optimized"!==t&&"json"!==t)throw Error('Expected mcpOutputFormat to be "optimized" or "json".');return t}(u.mcpOutputFormat)},p=function(t){if(!t||"object"!=typeof t||Array.isArray(t))return t;let{stateDir:r,mcpOutputFormat:e,...n}=t;return n}(i),f=await o(r,c.client),l=await (r.runCommand??s)(f,n,p);return{isError:!1,structuredContent:l,content:[{type:"text",text:function(r){if("json"===r.outputFormat)return a(r.result);let e=t({name:r.name,input:r.input,result:r.result});return"string"==typeof e?.text?e.text:a(e?.data??r.result)}({name:n,input:p,result:l,outputFormat:c.outputFormat})}]}}}}();async function o(t,r){if(t.createClient)return await t.createClient(r);let{createAgentDeviceClient:e}=await import("./9542.js");return e(r)}async function s(t,r,e){let n=await import("./command-surface.js");return await n.runCommand(t,r,e)}function a(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}async function u(t){if("2.0"!==t.jsonrpc||"string"!=typeof t.method)return f(t.id??null,-32600,"Invalid JSON-RPC request.");if(void 0===t.id)return null;try{var r,e;return r=t.id,e=await c(t.method,t.params),{jsonrpc:"2.0",id:r,result:e}}catch(r){if(r instanceof l)return f(t.id,-32601,r.message);return f(t.id,-32602,r instanceof Error?r.message:String(r))}}async function c(t,e){switch(t){case"initialize":return{protocolVersion:"2025-11-25",capabilities:{tools:{}},serverInfo:{name:"agent-device",version:n()}};case"ping":return{};case"tools/list":return{tools:r().map(t=>{var r;return{name:t.name,description:t.description,inputSchema:{...r=t.inputSchema,properties:{...r.properties,stateDir:{type:"string",description:"Agent-device state directory."},mcpOutputFormat:{type:"string",enum:["optimized","json"],description:"MCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately."}}}}})};case"tools/call":return await p(e);default:throw new l(`Unsupported MCP method: ${t}`)}}async function p(t){let r=function(t){if(!t||"object"!=typeof t||Array.isArray(t))throw Error("Expected object parameters.");return t}(t),e=function(t,r){let e=t[r];if("string"!=typeof e||0===e.length)throw Error(`Expected ${r} to be a non-empty string.`);return e}(r,"name");try{return await i.execute(e,r.arguments)}catch(t){return function(t,r=!1){return{isError:r,content:[{type:"text",text:t}]}}(t instanceof Error?t.message:String(t),!0)}}function f(t,r,e){return{jsonrpc:"2.0",id:t,error:{code:r,message:e}}}class l extends Error{}async function m(){let t=function(t={}){let r=t.handlePayload??d,e=t.write??h,n=Promise.resolve();return{push:t=>{var i;let o=Array.isArray(i=t)?1===i.length?i[0]?.id??null:null:i.id??null;n=n.then(async()=>{let n=await r(t);n&&e(n)}).catch(t=>{e({jsonrpc:"2.0",id:o,error:{code:-32603,message:t instanceof Error?t.message:String(t)}})})},idle:async()=>{await n}}}(),r=new g(r=>{t.push(r)});process.stdin.setEncoding("utf8"),process.stdin.on("data",t=>{try{r.push(t)}catch(t){h({jsonrpc:"2.0",id:null,error:{code:-32700,message:t instanceof Error?t.message:String(t)}})}}),await new Promise(t=>{process.stdin.on("end",t),process.stdin.on("close",t),process.stdin.resume()}),await t.idle()}function d(t){return Array.isArray(t)?y(t):u(t)}async function y(t){let r=[];for(let n of t){var e;r.push(...(e=await u(n))?[e]:[])}return r.length>0?r:null}class g{buffer="";sink;constructor(t){this.sink=t}push(t){for(this.buffer+=t;;){let t=this.tryReadLineMessage();if(void 0!==t){this.emit(t);continue}break}}tryReadLineMessage(){let t=this.buffer.indexOf("\n");if(-1===t)return;let r=this.buffer.slice(0,t).trim();return this.buffer=this.buffer.slice(t+1),r.length>0?r:void 0}emit(t){let r=JSON.parse(t);Array.isArray(r),this.sink(r)}}function h(t){process.stdout.write(`${JSON.stringify(t)}
|
|
2
|
+
`)}export{m as runAgentDeviceMcpServer};
|