agent-device
Advanced tools
+18
-20
| { | ||
| "name": "agent-device", | ||
| "version": "0.1.6", | ||
| "version": "0.1.7", | ||
| "description": "Unified control plane for physical and virtual devices via an agent-driven CLI.", | ||
@@ -14,20 +14,2 @@ "license": "MIT", | ||
| }, | ||
| "scripts": { | ||
| "lint": "node --eval \"console.log('no lint')\"", | ||
| "build": "rslib build", | ||
| "build:node": "pnpm build && rm -f ~/.agent-device/daemon.json", | ||
| "build:swift": "swift build -c release --package-path ios-runner/AXSnapshot", | ||
| "build:axsnapshot": "pnpm build:swift && mkdir -p dist/bin && cp -f ios-runner/AXSnapshot/.build/release/axsnapshot dist/bin/axsnapshot && chmod +x dist/bin/axsnapshot", | ||
| "build:xcuitest": "AGENT_DEVICE_IOS_CLEAN_DERIVED=1 xcodebuild build-for-testing -project ios-runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj -scheme AgentDeviceRunner -destination \"generic/platform=iOS Simulator\" -derivedDataPath ~/.agent-device/ios-runner/derived", | ||
| "build:clis": "pnpm build:node && pnpm build:axsnapshot", | ||
| "build:all": "pnpm build:node && pnpm build:axsnapshot && pnpm build:xcuitest", | ||
| "ad": "node bin/agent-device.mjs", | ||
| "format": "prettier --write .", | ||
| "prepublishOnly": "pnpm build:node && pnpm build:axsnapshot", | ||
| "prepack": "pnpm build:node && pnpm build:axsnapshot", | ||
| "typecheck": "tsc -p tsconfig.json", | ||
| "test": "node --test", | ||
| "test:smoke": "node --test test/smoke/*.test.ts", | ||
| "test:integration": "node --test test/integration/*.test.ts" | ||
| }, | ||
| "files": [ | ||
@@ -70,3 +52,19 @@ "bin", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "scripts": { | ||
| "lint": "node --eval \"console.log('no lint')\"", | ||
| "build": "rslib build", | ||
| "build:node": "pnpm build && rm -f ~/.agent-device/daemon.json", | ||
| "build:swift": "swift build -c release --package-path ios-runner/AXSnapshot", | ||
| "build:axsnapshot": "pnpm build:swift && mkdir -p dist/bin && cp -f ios-runner/AXSnapshot/.build/release/axsnapshot dist/bin/axsnapshot && chmod +x dist/bin/axsnapshot", | ||
| "build:xcuitest": "AGENT_DEVICE_IOS_CLEAN_DERIVED=1 xcodebuild build-for-testing -project ios-runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj -scheme AgentDeviceRunner -destination \"generic/platform=iOS Simulator\" -derivedDataPath ~/.agent-device/ios-runner/derived", | ||
| "build:clis": "pnpm build:node && pnpm build:axsnapshot", | ||
| "build:all": "pnpm build:node && pnpm build:axsnapshot && pnpm build:xcuitest", | ||
| "ad": "node bin/agent-device.mjs", | ||
| "format": "prettier --write .", | ||
| "typecheck": "tsc -p tsconfig.json", | ||
| "test": "node --test", | ||
| "test:smoke": "node --test test/smoke/*.test.ts", | ||
| "test:integration": "node --test test/integration/*.test.ts" | ||
| } | ||
| } | ||
| } |
+51
-0
@@ -1024,2 +1024,43 @@ import net from 'node:net'; | ||
| const refLabel = resolveRefLabel(node, session.snapshot.nodes); | ||
| const label = node.label?.trim(); | ||
| if (session.device.platform === 'ios' && session.device.kind === 'simulator') { | ||
| if (refLabel && isTextInputType(node.type)) { | ||
| await runIosRunnerCommand( | ||
| session.device, | ||
| { command: 'tap', text: refLabel, appBundleId: session.appBundleId }, | ||
| { verbose: req.flags?.verbose, logPath, traceLogPath: session?.trace?.outPath }, | ||
| ); | ||
| await runIosRunnerCommand( | ||
| session.device, | ||
| { command: 'type', text, appBundleId: session.appBundleId }, | ||
| { verbose: req.flags?.verbose, logPath, traceLogPath: session?.trace?.outPath }, | ||
| ); | ||
| recordAction(session, { | ||
| command, | ||
| positionals: req.positionals ?? [], | ||
| flags: req.flags ?? {}, | ||
| result: { ref, refLabel, mode: 'text' }, | ||
| }); | ||
| return { ok: true, data: { ref, mode: 'text' } }; | ||
| } | ||
| if (label && isLabelUnique(session.snapshot.nodes, label)) { | ||
| await runIosRunnerCommand( | ||
| session.device, | ||
| { command: 'tap', text: label, appBundleId: session.appBundleId }, | ||
| { verbose: req.flags?.verbose, logPath, traceLogPath: session?.trace?.outPath }, | ||
| ); | ||
| await runIosRunnerCommand( | ||
| session.device, | ||
| { command: 'type', text, appBundleId: session.appBundleId }, | ||
| { verbose: req.flags?.verbose, logPath, traceLogPath: session?.trace?.outPath }, | ||
| ); | ||
| recordAction(session, { | ||
| command, | ||
| positionals: req.positionals ?? [], | ||
| flags: req.flags ?? {}, | ||
| result: { ref, refLabel: label, mode: 'text' }, | ||
| }); | ||
| return { ok: true, data: { ref, mode: 'text' } }; | ||
| } | ||
| } | ||
| const { x, y } = centerOfRect(node.rect); | ||
@@ -1612,2 +1653,12 @@ const data = await dispatchCommand( | ||
| function isTextInputType(type: string | undefined): boolean { | ||
| const normalized = normalizeType(type ?? ''); | ||
| return ( | ||
| normalized === 'textfield' || | ||
| normalized === 'textview' || | ||
| normalized === 'searchfield' || | ||
| normalized === 'textarea' | ||
| ); | ||
| } | ||
| function pruneGroupNodes(nodes: RawSnapshotNode[]): RawSnapshotNode[] { | ||
@@ -1614,0 +1665,0 @@ const skippedDepths: number[] = []; |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
740569
0.41%5613
0.97%