agent-device 0.18.1 → 0.18.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/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.18.1.apk → agent-device-android-multitouch-helper-0.18.3.apk} +0 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.18.3.apk.sha256 +1 -0
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.18.1.manifest.json → agent-device-android-multitouch-helper-0.18.3.manifest.json} +4 -4
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.18.1.apk → agent-device-android-snapshot-helper-0.18.3.apk} +0 -0
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.18.3.apk.sha256 +1 -0
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.18.1.manifest.json → agent-device-android-snapshot-helper-0.18.3.manifest.json} +6 -6
- package/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +2 -1
- package/dist/src/1986.js +1 -1
- package/dist/src/2948.js +16 -16
- package/dist/src/3340.js +8 -8
- package/dist/src/4428.js +3 -3
- package/dist/src/495.js +5 -5
- package/dist/src/6849.js +1 -1
- package/dist/src/7871.js +1 -1
- package/dist/src/8184.js +1 -1
- package/dist/src/8414.js +2 -2
- package/dist/src/8875.js +4 -1
- package/dist/src/9581.js +3 -3
- package/dist/src/9624.js +1 -1
- package/dist/src/9722.js +38 -37
- package/dist/src/android.js +1 -1
- package/dist/src/apps.js +9 -9
- package/dist/src/audio-probe.js +1 -1
- package/dist/src/batch.d.ts +1 -1
- package/dist/src/cli-help.js +15 -8
- package/dist/src/cli.js +23 -23
- package/dist/src/contracts.d.ts +1 -1
- package/dist/src/devices.js +1 -1
- package/dist/src/devices~1.js +1 -1
- package/dist/src/index.d.ts +61 -16
- package/dist/src/input-actions.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interactor.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/record-trace-recording.js +3 -3
- package/dist/src/remote-config.d.ts +1 -1
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.d.ts +8 -4
- package/dist/src/session.js +11 -11
- package/dist/src/simulator.js +2 -2
- package/dist/src/snapshot.js +2 -2
- package/dist/src/web.js +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/skills/agent-device/SKILL.md +2 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.18.1.apk.sha256 +0 -1
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.18.1.apk.sha256 +0 -1
- package/dist/src/432.js +0 -4
package/dist/src/9624.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{emitDiagnostic as e}from"./
|
|
1
|
+
import{emitDiagnostic as e}from"./8875.js";import{AppError as t}from"./485.js";import{isClipboardShellUnsupported as i,resolveAndroidAdbExecutor as n}from"./3340.js";import{sleep as r}from"./5560.js";let o=new Set(["com.google.android.inputmethod.latin","com.samsung.android.honeyboard","com.touchtype.swiftkey","com.microsoft.swiftkey"]);function a(e){let t=u(e.packageName),i=(e.resourceId??"").toLowerCase(),n=u(e.activeInputMethodPackage);if(t&&n&&t===n)return{inputMethodOwned:!0,source:"active-input-method"};if(n&&i.startsWith(`${n}:id/`))return{inputMethodOwned:!0,source:"active-input-method-resource"};if(t&&o.has(t))return{inputMethodOwned:!0,source:"known-ime-package"};for(let e of o)if(i.startsWith(`${e}:id/`))return{inputMethodOwned:!0,source:"known-ime-resource"};return{inputMethodOwned:!1,source:"app"}}function d(e){return a(e).inputMethodOwned}function u(e){return(e??"").trim().toLowerCase()||void 0}let s=["mInputShown","mIsInputViewShown","isInputViewShown","mDecorViewVisible","mWindowVisible","mInShowWindow"],c=new Map([[2,"number"],[3,"phone"],[4,"datetime"]]),l=new Set([32,208]),p=new Set([128,224,144]);async function w(e){return await f(n(e))}async function f(i){var n,r,d;let w,f,h,m,I,y,g,_,C=await i(["shell","dumpsys","input_method"],{allowFailure:!0});if(0!==C.exitCode)throw new t("COMMAND_FAILED","Failed to query Android keyboard state",{stdout:C.stdout,stderr:C.stderr,exitCode:C.exitCode});return f=function(e){var t=function(e,t){let i=new Map,n=RegExp(`\\b(${t.join("|")})=([a-zA-Z]+)\\b`,"g");for(let t of e.matchAll(n)){let e=t[1],n=t[2]?.toLowerCase();e&&("true"===n||"false"===n)&&i.set(e,"true"===n)}return i}(e,s);if(0===t.size)return null;let i=A(t,["mWindowVisible","mDecorViewVisible","mInShowWindow"]);if(void 0!==i)return i;let n=t.get("mInputShown");return void 0!==n?n:A(t,["mIsInputViewShown","isInputViewShown"])??null}(n=C.stdout)??function(e){let t=e.match(/\bmImeWindowVis=0x([0-9a-fA-F]+)\b/),i=t?.[1];if(!i)return null;let n=Number.parseInt(i,16);return Number.isNaN(n)?null:(1&n)!=0}(n),h=(w=b(n,/\binputType=0x([0-9a-fA-F]+)\b/gi))?`0x${w.toLowerCase()}`:void 0,m=b(n,/\bpackageName=([A-Za-z0-9_.]+)\b/g),I=b(n,/\b(?:resourceId|resource-id)=([^\s,}]+)/g),g=function(e,t,i){return e||t?a({packageName:e,resourceId:t,activeInputMethodPackage:i}).inputMethodOwned?"ime":"app":"unknown"}(m,I,y=function(e){for(let t of[/\bmCurMethodId=([^\s]+)/i,/\bmCurId=([^\s]+)/i,/\bmCurrentInputMethodId=([^\s]+)/i,/\bcurMethodId=([^\s]+)/i]){let i=e.match(t),n=function(e){let t=(e??"").trim();if(!t)return;let i=(t.split("/")[0]??"").match(/[a-zA-Z0-9_.]+/);return u(i?.[0])}(i?.[1]);if(n)return n}}(n)),r=m,d=I,!y&&((_=u(r))&&o.has(_)||function(e){let t=(e??"").toLowerCase();for(let e of o)if(t.startsWith(`${e}:id/`))return!0;return!1}(d))&&e({level:"warn",phase:"android_input_ownership_fallback",data:{focusedPackage:r,focusedResourceId:d}}),{visible:f??!1,inputType:h,type:h?function(e){let t=Number.parseInt(e.replace(/^0x/i,""),16);if(Number.isNaN(t))return"unknown";let i=15&t,n=c.get(i);if(n)return n;if(1!==i)return"unknown";let r=4080&t;return l.has(r)?"email":p.has(r)?"password":"text"}(h):void 0,inputMethodPackage:y,focusedPackage:m,focusedResourceId:I,inputOwner:g}}async function h(e){return await m(n(e))}async function m(e){let i=await f(e),n=i,o=0;for(;n.visible&&o<2;)await e(["shell","input","keyevent","111"]),o+=1,await r(120),n=await f(e);if(i.visible&&n.visible)throw new t("UNSUPPORTED_OPERATION","Android keyboard dismiss is unavailable for the current IME without back navigation.",{attempts:o,inputType:n.inputType,type:n.type,inputMethodPackage:n.inputMethodPackage,focusedPackage:n.focusedPackage,focusedResourceId:n.focusedResourceId,inputOwner:n.inputOwner});return{attempts:o,wasVisible:i.visible,dismissed:i.visible&&!n.visible,visible:n.visible,inputType:n.inputType,type:n.type,inputMethodPackage:n.inputMethodPackage,focusedPackage:n.focusedPackage,focusedResourceId:n.focusedResourceId,inputOwner:n.inputOwner}}function b(e,t){let i;for(let n of e.matchAll(t))i=n[1];return i}function A(e,t){for(let i of t){let t=e.get(i);if(void 0!==t)return t}}async function I(e){return await y(n(e))}async function y(e){let t,i;return(i=(t=(await C(e,["shell","cmd","clipboard","get","text"],"read")).replace(/\r\n/g,"\n").replace(/\n$/,"")).match(/^clipboard text:\s*(.*)$/i))?i[1]??"":"null"===t.trim().toLowerCase()?"":t}async function g(e,t){await _(n(e),t)}async function _(e,t){await C(e,["shell","cmd","clipboard","set","text",t],"write")}async function C(e,n,r){let o=await e(n,{allowFailure:!0});if(i(o.stdout,o.stderr))throw new t("UNSUPPORTED_OPERATION",`Android shell clipboard ${r} is not supported on this device.`);if(0!==o.exitCode)throw new t("COMMAND_FAILED",`Failed to ${r} Android clipboard text`,{stdout:o.stdout,stderr:o.stderr,exitCode:o.exitCode});return o.stdout}export{h as dismissAndroidKeyboard,m as dismissAndroidKeyboardWithAdb,w as getAndroidKeyboardState,f as getAndroidKeyboardStatusWithAdb,d as isAndroidInputMethodOwnedNode,I as readAndroidClipboardText,y as readAndroidClipboardWithAdb,g as writeAndroidClipboardText,_ as writeAndroidClipboardWithAdb};
|