@swmansion/argent 0.33.1-next.16 → 0.33.1-next.18
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/dist/cli-cmds.mjs +1 -1
- package/dist/installer.mjs +1 -1
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Snapshot.swift +110 -4
- package/dist/tool-args.generated.d.ts +2 -0
- package/dist/tool-server.cjs +36 -60
- package/package.json +1 -1
- package/skills/argent-create-e2e/references/reliability-and-recovery.md +1 -1
- package/skills/argent-device-interact/SKILL.md +1 -1
- package/skills/argent-device-interact/references/harmonyos.md +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -36069,7 +36069,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
36069
36069
|
var SESSION_ID2 = randomUUID5();
|
|
36070
36070
|
function readCliVersion() {
|
|
36071
36071
|
if (true) {
|
|
36072
|
-
return "0.33.1-next.
|
|
36072
|
+
return "0.33.1-next.18";
|
|
36073
36073
|
}
|
|
36074
36074
|
return "0.0.0";
|
|
36075
36075
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -16986,7 +16986,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
16986
16986
|
var SESSION_ID = randomUUID4();
|
|
16987
16987
|
function readCliVersion() {
|
|
16988
16988
|
if (true) {
|
|
16989
|
-
return "0.33.1-next.
|
|
16989
|
+
return "0.33.1-next.18";
|
|
16990
16990
|
}
|
|
16991
16991
|
return "0.0.0";
|
|
16992
16992
|
}
|
package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Snapshot.swift
CHANGED
|
@@ -26,6 +26,16 @@ extension ArgentRunnerSession {
|
|
|
26
26
|
/// Ceiling on emitted node depth.
|
|
27
27
|
private static let emittedDepthLimit = 60
|
|
28
28
|
|
|
29
|
+
/// View services that present UI over the registered app from their own
|
|
30
|
+
/// process. On iOS 26 the host app's tree no longer bridges into them, so
|
|
31
|
+
/// an ASWebAuthenticationSession or SFSafariViewController sheet is missing
|
|
32
|
+
/// from the app's snapshot even though it covers the screen.
|
|
33
|
+
private static let hostedViewServiceBundleIds = ["com.apple.SafariViewService"]
|
|
34
|
+
|
|
35
|
+
/// Share of the node budget a hosted service may use. A heavy web page
|
|
36
|
+
/// must not crowd out the app's own nodes and the keyboard.
|
|
37
|
+
private static let hostedNodeBudget = 1000
|
|
38
|
+
|
|
29
39
|
/// Captures the app's accessibility tree and flattens it into a snapshot
|
|
30
40
|
/// payload. The capture is retried once after a short pause: this is the
|
|
31
41
|
/// one runner-side retry, kept here because the capture can read its own
|
|
@@ -70,7 +80,7 @@ extension ArgentRunnerSession {
|
|
|
70
80
|
)
|
|
71
81
|
}
|
|
72
82
|
|
|
73
|
-
let nodes = Self.flatten(root)
|
|
83
|
+
let nodes = Self.flatten(root, hosted: hostedServiceRoots(over: root))
|
|
74
84
|
let capped = nodes.count >= Self.snapshotNodeBudget
|
|
75
85
|
|
|
76
86
|
return .success(
|
|
@@ -88,28 +98,122 @@ extension ArgentRunnerSession {
|
|
|
88
98
|
)
|
|
89
99
|
}
|
|
90
100
|
|
|
101
|
+
/// Trees of the hosted view services presenting over `root` right now.
|
|
102
|
+
/// The service is read through a proxy and never activated: activating it
|
|
103
|
+
/// would front it as a standalone app and black out the screen.
|
|
104
|
+
///
|
|
105
|
+
/// Only a foreground service is read. A suspended one, where the service
|
|
106
|
+
/// stays after its sheet closes, blocks `snapshot()` past the command
|
|
107
|
+
/// watchdog and leaves the runner busy. A background one returns stale
|
|
108
|
+
/// pieces of the closed sheet. A tree whose size differs from the app's
|
|
109
|
+
/// belongs to a sheet still animating in or out, and its frames would
|
|
110
|
+
/// mislead taps, so it is dropped too. A failure here never fails the
|
|
111
|
+
/// app's own snapshot.
|
|
112
|
+
private func hostedServiceRoots(over root: XCUIElementSnapshot)
|
|
113
|
+
-> [XCUIElementSnapshot]
|
|
114
|
+
{
|
|
115
|
+
// Before iOS 26 the app's tree already carries the hosted browser.
|
|
116
|
+
if Self.containsHostedBrowser(root) { return [] }
|
|
117
|
+
|
|
118
|
+
var roots: [XCUIElementSnapshot] = []
|
|
119
|
+
|
|
120
|
+
for bundleId in Self.hostedViewServiceBundleIds {
|
|
121
|
+
let service = XCUIApplication(bundleIdentifier: bundleId)
|
|
122
|
+
guard service.state == .runningForeground else { continue }
|
|
123
|
+
|
|
124
|
+
var hosted: XCUIElementSnapshot?
|
|
125
|
+
var failure: String?
|
|
126
|
+
let started = Date()
|
|
127
|
+
let exceptionDescription = ArgentExceptionGuard.runCatching {
|
|
128
|
+
do {
|
|
129
|
+
hosted = try service.snapshot()
|
|
130
|
+
} catch {
|
|
131
|
+
failure = String(describing: error)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
let elapsedMs = Int(Date().timeIntervalSince(started) * 1000)
|
|
135
|
+
|
|
136
|
+
guard let hosted, service.state == .runningForeground,
|
|
137
|
+
Self.sameSize(hosted.frame, root.frame)
|
|
138
|
+
else {
|
|
139
|
+
NSLog(
|
|
140
|
+
"ARGENT_HOSTED_SKIPPED bundle=%@ ms=%d reason=%@",
|
|
141
|
+
bundleId, elapsedMs,
|
|
142
|
+
exceptionDescription ?? failure ?? "not settled on screen"
|
|
143
|
+
)
|
|
144
|
+
continue
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
NSLog("ARGENT_HOSTED bundle=%@ ms=%d", bundleId, elapsedMs)
|
|
148
|
+
roots.append(hosted)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return roots
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/// Whether the tree holds SafariViewService's browser container, whose
|
|
155
|
+
/// identifier starts with "BrowserView". An app's own web view does not
|
|
156
|
+
/// count. Bounded by the raw depth limit.
|
|
157
|
+
private static func containsHostedBrowser(_ root: XCUIElementSnapshot)
|
|
158
|
+
-> Bool
|
|
159
|
+
{
|
|
160
|
+
var stack: [(XCUIElementSnapshot, Int)] = [(root, 0)]
|
|
161
|
+
|
|
162
|
+
while let (snapshot, depth) = stack.popLast() {
|
|
163
|
+
if snapshot.identifier.hasPrefix("BrowserView") { return true }
|
|
164
|
+
if depth >= rawDepthLimit { continue }
|
|
165
|
+
stack.append(contentsOf: snapshot.children.map { ($0, depth + 1) })
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return false
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/// Whether two frames have the same size within a point.
|
|
172
|
+
private static func sameSize(_ a: CGRect, _ b: CGRect) -> Bool {
|
|
173
|
+
abs(a.width - b.width) < 1 && abs(a.height - b.height) < 1
|
|
174
|
+
}
|
|
175
|
+
|
|
91
176
|
/// Flattens the snapshot tree into an ordered node list. Keeps elements an
|
|
92
177
|
/// agent can name or act on, assigns indices and parent links in emission
|
|
93
|
-
/// order, and dedupes mirror elements.
|
|
94
|
-
|
|
178
|
+
/// order, and dedupes mirror elements. `hosted` trees of view services
|
|
179
|
+
/// presenting over the app are emitted first under the root, within
|
|
180
|
+
/// their own share of the node budget.
|
|
181
|
+
static func flatten(
|
|
182
|
+
_ root: XCUIElementSnapshot,
|
|
183
|
+
hosted: [XCUIElementSnapshot] = []
|
|
184
|
+
) -> [SnapshotNodePayload] {
|
|
95
185
|
struct WorkItem {
|
|
96
186
|
let snapshot: XCUIElementSnapshot
|
|
97
187
|
let rawDepth: Int
|
|
98
188
|
let emittedDepth: Int
|
|
99
189
|
let parentIndex: Int
|
|
190
|
+
var hosted = false
|
|
100
191
|
}
|
|
101
192
|
|
|
102
193
|
let viewport = root.frame
|
|
103
194
|
var nodes = [makeNode(root, index: 0, depth: 0, parentIndex: nil)]
|
|
104
195
|
var seen: Set<String> = [identity(root)]
|
|
196
|
+
var hostedEmitted = 0
|
|
105
197
|
|
|
106
198
|
var stack = root.children.reversed().map {
|
|
107
199
|
WorkItem(snapshot: $0, rawDepth: 1, emittedDepth: 1, parentIndex: 0)
|
|
108
200
|
}
|
|
109
201
|
|
|
202
|
+
// Pushed last so they are walked first: they cover the screen, and the
|
|
203
|
+
// app's keyboard keys must not use up the budget before them.
|
|
204
|
+
stack.append(
|
|
205
|
+
contentsOf: hosted.reversed().map {
|
|
206
|
+
WorkItem(
|
|
207
|
+
snapshot: $0, rawDepth: 1, emittedDepth: 1, parentIndex: 0,
|
|
208
|
+
hosted: true
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
|
|
110
213
|
while let item = stack.popLast() {
|
|
111
214
|
if nodes.count >= snapshotNodeBudget { break }
|
|
112
215
|
if item.rawDepth > rawDepthLimit { continue }
|
|
216
|
+
if item.hosted && hostedEmitted >= hostedNodeBudget { continue }
|
|
113
217
|
|
|
114
218
|
let snapshot = item.snapshot
|
|
115
219
|
let frame = snapshot.frame
|
|
@@ -141,6 +245,7 @@ extension ArgentRunnerSession {
|
|
|
141
245
|
|
|
142
246
|
childParentIndex = index
|
|
143
247
|
childEmittedDepth += 1
|
|
248
|
+
if item.hosted { hostedEmitted += 1 }
|
|
144
249
|
}
|
|
145
250
|
|
|
146
251
|
for child in snapshot.children.reversed() {
|
|
@@ -149,7 +254,8 @@ extension ArgentRunnerSession {
|
|
|
149
254
|
snapshot: child,
|
|
150
255
|
rawDepth: item.rawDepth + 1,
|
|
151
256
|
emittedDepth: childEmittedDepth,
|
|
152
|
-
parentIndex: childParentIndex
|
|
257
|
+
parentIndex: childParentIndex,
|
|
258
|
+
hosted: item.hosted
|
|
153
259
|
)
|
|
154
260
|
)
|
|
155
261
|
}
|
|
@@ -598,6 +598,8 @@ export interface ArgentToolArgs {
|
|
|
598
598
|
skipClassPrefixes?: Array<string>;
|
|
599
599
|
/** Maximum depth for returned child/ancestor serialization (default 150) */
|
|
600
600
|
maxDepth?: number;
|
|
601
|
+
/** true returns the view that would receive a touch at the point: it respects userInteractionEnabled, close to UIKit hit-testing. Default false: the deepest visible view. */
|
|
602
|
+
hitTest?: boolean;
|
|
601
603
|
};
|
|
602
604
|
"open-url": {
|
|
603
605
|
/** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
|
package/dist/tool-server.cjs
CHANGED
|
@@ -101278,7 +101278,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
101278
101278
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
101279
101279
|
function readCliVersion() {
|
|
101280
101280
|
if (true) {
|
|
101281
|
-
return "0.33.1-next.
|
|
101281
|
+
return "0.33.1-next.18";
|
|
101282
101282
|
}
|
|
101283
101283
|
return "0.0.0";
|
|
101284
101284
|
}
|
|
@@ -123989,7 +123989,7 @@ var NATIVE_DEVTOOLS_NAMESPACE = "NativeDevtools";
|
|
|
123989
123989
|
function isInjectableBundleId(bundleId) {
|
|
123990
123990
|
return !bundleId.toLowerCase().startsWith("com.apple.");
|
|
123991
123991
|
}
|
|
123992
|
-
var NON_INJECTABLE_NATIVE_WARNING = "Do not fall back to the native-devtools feature tools (native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point
|
|
123992
|
+
var NON_INJECTABLE_NATIVE_WARNING = "Do not fall back to the native-devtools feature tools (native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point): they run the same injection precheck and fail with the same non-injectable error.";
|
|
123993
123993
|
var NON_INJECTABLE_RECOVERY = "Use the standard `describe` tool (its accessibility path reads the screen without injection) or `screenshot` (then interact by coordinate). " + NON_INJECTABLE_NATIVE_WARNING;
|
|
123994
123994
|
var MAX_NATIVE_DEVTOOLS_INIT_ATTEMPTS = 3;
|
|
123995
123995
|
var NATIVE_DEVTOOLS_AGE_SLOP_MS = 3e3;
|
|
@@ -146695,7 +146695,7 @@ Returns { envSetup, appRunning, connected, requiresRestart, state, message, next
|
|
|
146695
146695
|
- nextLaunchWillBeInjected: if you launch this bundle now, native devtools env setup is already in place (always false for a non-injectable app)
|
|
146696
146696
|
- injectable: false for Apple system apps (bundle ids under com.apple.), which the native tools refuse to read.
|
|
146697
146697
|
|
|
146698
|
-
If injectable is false: treat this as TERMINAL. The app is not a supported native-devtools target, and no relaunch changes that. Do NOT restart/retry. Use the standard \`describe\` tool (its accessibility path reads the screen without injection) or \`screenshot\` (then interact by coordinate). Do not fall back to the native-devtools feature tools (native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point
|
|
146698
|
+
If injectable is false: treat this as TERMINAL. The app is not a supported native-devtools target, and no relaunch changes that. Do NOT restart/retry. Use the standard \`describe\` tool (its accessibility path reads the screen without injection) or \`screenshot\` (then interact by coordinate). Do not fall back to the native-devtools feature tools (native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point): they run the same injection precheck and fail with the same non-injectable error.
|
|
146699
146699
|
If appRunning is false and nextLaunchWillBeInjected is true: use launch-app normally.
|
|
146700
146700
|
If requiresRestart is true: call restart-app once, then proceed with the native feature. Read state before acting on a second such reading. Indeterminate reaches this rule too, and its line below bounds it at that one restart.
|
|
146701
146701
|
If state is unregistered: do NOT restart the app again: it already launched under the terms a restart would recreate. Restart the tool-server (\`argent server stop && argent server start --detach\`), then retry. If it reads unregistered again after that restart, stop: the process loads argent's dylib but never dials, and no further restart on either side changes it. Treat native devtools as unavailable, then use \`describe\` or \`screenshot\` and drive by coordinate.
|
|
@@ -147076,7 +147076,7 @@ var nativeFindViewsTool = {
|
|
|
147076
147076
|
id: "native-find-views",
|
|
147077
147077
|
description: `Search for specific UIViews in the running app by class name, accessibility identifier, accessibility label, tag or React Native nativeID; at least one of these params is required.
|
|
147078
147078
|
Use when you need to locate a specific view by its properties without dumping the entire native-full-hierarchy.
|
|
147079
|
-
Returns { status: "ok", matches }: the matching views with their frames, properties, optional ancestors and optional children. Frames are in points. frame and center are relative to the superview, and windowFrame turns with the UI. To tap a view, divide the centre of its screenFrame by the screen size in points, which native-full-hierarchy returns as screen (maxDepth: 1 is enough), and pass the result to gesture-tap. Matches are not filtered for visibility. Before tapping, call native-
|
|
147079
|
+
Returns { status: "ok", matches }: the matching views with their frames, properties, optional ancestors and optional children. Frames are in points. frame and center are relative to the superview, and windowFrame turns with the UI. To tap a view, divide the centre of its screenFrame by the screen size in points, which native-full-hierarchy returns as screen (maxDepth: 1 is enough), and pass the result to gesture-tap. Matches are not filtered for visibility. Before tapping, call native-view-at-point with hitTest: true at that centre, with skipClasses ["UITextEffectsWindow"]. If it does not return the match or a descendant, check a screenshot.
|
|
147080
147080
|
<flag:macos-apps>On a Mac app it searches the NSViews of every visible window: className is the NSView class, and identifier matches the accessibility identifier or the view identifier. SwiftUI sets a control's identifier and label on an accessibility element, not on an NSView, so an identifier or label search does not find SwiftUI controls: describe lists them with their identifiers and frames. The tap recipe above and the statuses below are iOS only.
|
|
147081
147081
|
</flag:macos-apps>If status is restart_required: follow the message (usually restart-app), then retry. If status is service_stale: the app is already injected, so restarting it cannot help. Restart the tool-server (\`argent server stop && argent server start --detach\`) and retry. If the same status comes back after that restart, stop restarting: follow the message, which names the terminal fallback. If status is connect_pending: the app is injected and still connecting. Do not restart it, wait a few seconds and retry. If status is init_failed: follow the message (re-boot the simulator) rather than retrying.
|
|
147082
147082
|
An Apple system app is rejected outright (terminal: never retry it).`,
|
|
@@ -147232,7 +147232,7 @@ An Apple system app is rejected outright (terminal: never retry it).`,
|
|
|
147232
147232
|
// ../tool-server/src/tools/native-devtools/native-view-at-point.ts
|
|
147233
147233
|
init_zod();
|
|
147234
147234
|
init_src2();
|
|
147235
|
-
var
|
|
147235
|
+
var viewAtPointParams = {
|
|
147236
147236
|
...nativeAppTarget,
|
|
147237
147237
|
x: external_exports.number().describe(
|
|
147238
147238
|
"Raw X coordinate in points, on the portrait axes of the screen<flag:macos-apps>; on a Mac app, points from the top-left of the area describe reports</flag:macos-apps>. NOT normalized [0,1] tap space."
|
|
@@ -147246,21 +147246,39 @@ var zodSchema8 = external_exports.object({
|
|
|
147246
147246
|
skipClasses: external_exports.array(external_exports.string()).optional().describe("Exact UIView class names whose entire subtree should be pruned"),
|
|
147247
147247
|
skipClassPrefixes: external_exports.array(external_exports.string()).optional().describe("Class name prefixes to prune entire subtrees"),
|
|
147248
147248
|
maxDepth: external_exports.number().int().positive().optional().describe("Maximum depth for returned child/ancestor serialization (default 150)")
|
|
147249
|
+
};
|
|
147250
|
+
var zodSchema8 = external_exports.object({
|
|
147251
|
+
...viewAtPointParams,
|
|
147252
|
+
hitTest: external_exports.boolean().optional().describe(
|
|
147253
|
+
"true returns the view that would receive a touch at the point: it respects userInteractionEnabled, close to UIKit hit-testing. Default false: the deepest visible view."
|
|
147254
|
+
)
|
|
147249
147255
|
});
|
|
147256
|
+
function queryViewAtPoint(services, params, toolId, hitTest) {
|
|
147257
|
+
return queryViewHierarchyFor(
|
|
147258
|
+
services,
|
|
147259
|
+
params,
|
|
147260
|
+
toolId,
|
|
147261
|
+
hitTest ? "ViewHierarchy.userInteractableViewAtPoint" : "ViewHierarchy.viewAtPoint",
|
|
147262
|
+
hitTest ? FAILURE_CODES.NATIVE_DEVTOOLS_USER_INTERACTABLE_VIEW_AT_POINT_ERROR : FAILURE_CODES.NATIVE_DEVTOOLS_VIEW_AT_POINT_ERROR,
|
|
147263
|
+
(result) => ({ status: "ok", view: result.view ?? null })
|
|
147264
|
+
);
|
|
147265
|
+
}
|
|
147250
147266
|
var nativeViewAtPointTool = {
|
|
147251
147267
|
id: "native-view-at-point",
|
|
147252
|
-
description: `Inspect the deepest
|
|
147253
|
-
|
|
147254
|
-
Unlike native-user-interactable-view-at-point, this ignores userInteractionEnabled,
|
|
147255
|
-
so it answers "what is visually here?" rather than "what would receive the touch?".
|
|
147268
|
+
description: `Inspect the deepest UIView at a raw native window point: the one drawn there, or with hitTest: true the one that would receive a touch.
|
|
147256
147269
|
|
|
147270
|
+
Without hitTest it ignores userInteractionEnabled and answers "what is visually here?".
|
|
147257
147271
|
Use when a screenshot shows something the accessibility tree does not name (an
|
|
147258
147272
|
unlabeled icon, a decorative overlay, a custom-drawn cell) and you need the class,
|
|
147259
147273
|
identifier or nativeID of whatever draws it.
|
|
147260
147274
|
|
|
147275
|
+
With hitTest: true it answers "what would receive the touch?". Use when a tap lands
|
|
147276
|
+
somewhere unexpected or does nothing, to see which control UIKit would hand the
|
|
147277
|
+
touch to: a transparent overlay swallowing it, a parent recognizer, a disabled button.
|
|
147278
|
+
|
|
147261
147279
|
Returns { status: "ok", view }: the matched view with its class name, frames,
|
|
147262
147280
|
identifier, label and layer name, plus its ancestors and subviews as requested.
|
|
147263
|
-
view is null when nothing is drawn at that point.
|
|
147281
|
+
view is null when nothing is drawn at that point, or with hitTest when no touchable view sits under it.
|
|
147264
147282
|
|
|
147265
147283
|
To get x and y from a normalized describe frame, multiply its values by the
|
|
147266
147284
|
screen size in points, also when the UI is landscape.
|
|
@@ -147272,9 +147290,9 @@ An Apple system app is rejected outright (terminal: never retry it).`,
|
|
|
147272
147290
|
zodSchema: zodSchema8,
|
|
147273
147291
|
readOnly: true,
|
|
147274
147292
|
interaction: {
|
|
147275
|
-
startedMsg: ({ params }) => `Inspecting native view at (${params.x}, ${params.y})`,
|
|
147276
|
-
completedMsg: ({ params }) => `Inspected native view at (${params.x}, ${params.y})`,
|
|
147277
|
-
failedMsg: ({ params, failureSignal: failureSignal2 }) => `Failed to inspect native view at (${params.x}, ${params.y}): ${failureSignal2.error_code}`
|
|
147293
|
+
startedMsg: ({ params }) => params.hitTest ? `Finding interactive view at (${params.x}, ${params.y})` : `Inspecting native view at (${params.x}, ${params.y})`,
|
|
147294
|
+
completedMsg: ({ params }) => params.hitTest ? `Found interactive view at (${params.x}, ${params.y})` : `Inspected native view at (${params.x}, ${params.y})`,
|
|
147295
|
+
failedMsg: ({ params, failureSignal: failureSignal2 }) => params.hitTest ? `Failed to find interactive view at (${params.x}, ${params.y}): ${failureSignal2.error_code}` : `Failed to inspect native view at (${params.x}, ${params.y}): ${failureSignal2.error_code}`
|
|
147278
147296
|
},
|
|
147279
147297
|
capability: {
|
|
147280
147298
|
apple: { simulator: true },
|
|
@@ -147282,57 +147300,22 @@ An Apple system app is rejected outright (terminal: never retry it).`,
|
|
|
147282
147300
|
macos: { app: true }
|
|
147283
147301
|
},
|
|
147284
147302
|
services: nativeAppServices,
|
|
147285
|
-
execute: (services,
|
|
147286
|
-
services,
|
|
147287
|
-
params,
|
|
147288
|
-
"native-view-at-point",
|
|
147289
|
-
"ViewHierarchy.viewAtPoint",
|
|
147290
|
-
FAILURE_CODES.NATIVE_DEVTOOLS_VIEW_AT_POINT_ERROR,
|
|
147291
|
-
(result) => ({ status: "ok", view: result.view ?? null })
|
|
147292
|
-
)
|
|
147303
|
+
execute: (services, { hitTest, ...query }) => queryViewAtPoint(services, query, "native-view-at-point", hitTest === true)
|
|
147293
147304
|
};
|
|
147294
147305
|
|
|
147295
147306
|
// ../tool-server/src/tools/native-devtools/native-user-interactable-view-at-point.ts
|
|
147296
147307
|
init_zod();
|
|
147297
|
-
|
|
147298
|
-
var zodSchema9 = external_exports.object({
|
|
147299
|
-
...nativeAppTarget,
|
|
147300
|
-
x: external_exports.number().describe(
|
|
147301
|
-
"Raw X coordinate in points, on the portrait axes of the screen<flag:macos-apps>; on a Mac app, points from the top-left of the area describe reports</flag:macos-apps>. NOT normalized [0,1] tap space."
|
|
147302
|
-
),
|
|
147303
|
-
y: external_exports.number().describe("Raw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space."),
|
|
147304
|
-
includeAncestors: external_exports.boolean().optional().describe("Include ancestor chain for the matched view (default true)"),
|
|
147305
|
-
includeChildren: external_exports.boolean().optional().describe("Include child views for the matched view (default false)"),
|
|
147306
|
-
fields: external_exports.array(external_exports.string()).optional().describe(
|
|
147307
|
-
"View fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder"
|
|
147308
|
-
),
|
|
147309
|
-
skipClasses: external_exports.array(external_exports.string()).optional().describe("Exact UIView class names whose entire subtree should be pruned"),
|
|
147310
|
-
skipClassPrefixes: external_exports.array(external_exports.string()).optional().describe("Class name prefixes to prune entire subtrees"),
|
|
147311
|
-
maxDepth: external_exports.number().int().positive().optional().describe("Maximum depth for returned child/ancestor serialization (default 150)")
|
|
147312
|
-
});
|
|
147308
|
+
var zodSchema9 = external_exports.object(viewAtPointParams);
|
|
147313
147309
|
var nativeUserInteractableViewAtPointTool = {
|
|
147314
147310
|
id: "native-user-interactable-view-at-point",
|
|
147315
147311
|
description: `Inspect the deepest UIView at a raw native window point that would actually receive touch input.
|
|
147316
147312
|
|
|
147317
|
-
|
|
147318
|
-
UIKit hit-testing semantics.
|
|
147319
|
-
|
|
147320
|
-
Use when a tap lands somewhere unexpected or does nothing, to see which control
|
|
147321
|
-
UIKit would hand the touch to: a transparent overlay swallowing it, a parent
|
|
147322
|
-
recognizer, a disabled button.
|
|
147323
|
-
|
|
147324
|
-
Returns { status: "ok", view }: the hit-test winner with its class name, frames,
|
|
147325
|
-
identifier, label and layer name, plus its ancestors and subviews as requested.
|
|
147326
|
-
view is null when no touchable view sits under that point.
|
|
147327
|
-
|
|
147328
|
-
To get x and y from a normalized describe frame, multiply its values by the
|
|
147329
|
-
screen size in points, also when the UI is landscape.
|
|
147330
|
-
native-full-hierarchy returns that size as screen (pass maxDepth: 1 and fields: ["className"] to keep it small).<flag:macos-apps> On a Mac app,
|
|
147331
|
-
multiply them by the size of the area describe reports instead.</flag:macos-apps>
|
|
147313
|
+
It respects userInteractionEnabled and is close to UIKit hit-testing. The same query as native-view-at-point with hitTest: true, which documents the coordinates and the result.
|
|
147332
147314
|
|
|
147333
147315
|
If status is restart_required: follow the message (usually restart-app), then retry. If status is service_stale: the app is already injected, so restarting it cannot help. Restart the tool-server (\`argent server stop && argent server start --detach\`) and retry. If the same status comes back after that restart, stop restarting: follow the message, which names the terminal fallback. If status is connect_pending: the app is injected and still connecting. Do not restart it, wait a few seconds and retry. If status is init_failed: follow the message (re-boot the simulator) rather than retrying.
|
|
147334
147316
|
An Apple system app is rejected outright (terminal: never retry it).`,
|
|
147335
147317
|
zodSchema: zodSchema9,
|
|
147318
|
+
hideFromMcp: true,
|
|
147336
147319
|
readOnly: true,
|
|
147337
147320
|
interaction: {
|
|
147338
147321
|
startedMsg: ({ params }) => `Finding interactive view at (${params.x}, ${params.y})`,
|
|
@@ -147345,14 +147328,7 @@ An Apple system app is rejected outright (terminal: never retry it).`,
|
|
|
147345
147328
|
macos: { app: true }
|
|
147346
147329
|
},
|
|
147347
147330
|
services: nativeAppServices,
|
|
147348
|
-
execute: (services, params) =>
|
|
147349
|
-
services,
|
|
147350
|
-
params,
|
|
147351
|
-
"native-user-interactable-view-at-point",
|
|
147352
|
-
"ViewHierarchy.userInteractableViewAtPoint",
|
|
147353
|
-
FAILURE_CODES.NATIVE_DEVTOOLS_USER_INTERACTABLE_VIEW_AT_POINT_ERROR,
|
|
147354
|
-
(result) => ({ status: "ok", view: result.view ?? null })
|
|
147355
|
-
)
|
|
147331
|
+
execute: (services, params) => queryViewAtPoint(services, params, "native-user-interactable-view-at-point", true)
|
|
147356
147332
|
};
|
|
147357
147333
|
|
|
147358
147334
|
// ../tool-server/src/blueprints/js-runtime-debugger.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.33.1-next.
|
|
3
|
+
"version": "0.33.1-next.18",
|
|
4
4
|
"mcpName": "io.github.software-mansion/argent",
|
|
5
5
|
"description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -99,7 +99,7 @@ When an overlay intersects the next target:
|
|
|
99
99
|
3. Record the same selector as `hidden`.
|
|
100
100
|
4. Only then touch the covered region.
|
|
101
101
|
|
|
102
|
-
Do not rely on auto-dismiss timers. Prefer an app e2e affordance that disables transient overlays. On iOS, use `native-
|
|
102
|
+
Do not rely on auto-dismiss timers. Prefer an app e2e affordance that disables transient overlays. On iOS, use `native-view-at-point` with `hitTest: true` for hit-test diagnosis. Other platforms rely on the recorded visibility trio.
|
|
103
103
|
|
|
104
104
|
Keep a dismissal swipe only when the UI supports it. Pass it through the coordinate gate and hard-check that the overlay disappeared.
|
|
105
105
|
|
|
@@ -46,7 +46,7 @@ After an action moves you to a different screen, or whenever you don't know an e
|
|
|
46
46
|
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
47
47
|
| Any screen: app, system dialog, Home screen | `describe` |
|
|
48
48
|
| UIKit properties of a view (iOS simulator) | `native-find-views` (needs `bundleId` and a class, id, label, tag or `nativeID` to match) |
|
|
49
|
-
| What sits at a known raw point (iOS simulator) | `native-
|
|
49
|
+
| What sits at a known raw point (iOS simulator) | `native-view-at-point` (the visually deepest view; `hitTest: true` for the view that receives touch) |
|
|
50
50
|
| Final visual fallback | `screenshot`, only when the tools above cannot expose the control. Do not derive routine in-app navigation targets from pixels |
|
|
51
51
|
|
|
52
52
|
If `describe` returns an empty tree, follow its `hint`; with no hint, the screen is blank, loading or unlabeled: check the attached screenshot and retry once content has loaded.
|
|
@@ -17,7 +17,7 @@ Refused as unsupported on harmony:
|
|
|
17
17
|
|
|
18
18
|
- `gesture-rotate` and `gesture-custom`: the device moves each contact along one straight line per call, so there is no arc and no long-press. There is no long-press tool on HarmonyOS.
|
|
19
19
|
- `gesture-drag` and `gesture-scroll` (Chromium-only), and `rotate`: the device has no orientation command.
|
|
20
|
-
- `native-view-at-point`, `
|
|
20
|
+
- `native-view-at-point`, `debugger-component-tree`, the rest of the debugger (`debugger-evaluate`, `debugger-log-registry`), `view-network-logs` and the profilers.
|
|
21
21
|
- `paste`, so a `{{secret:...}}` placeholder goes through `keyboard` only.
|
|
22
22
|
- Screen recording: HarmonyOS exposes no readable frame stream. Use `screenshot` for a still frame.
|
|
23
23
|
|