@swmansion/argent 0.33.1-next.17 → 0.33.1-next.19
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/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- 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-server.cjs +17 -8
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
package/bin/darwin/ax-service
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/tcp/ax-service
CHANGED
|
Binary file
|
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.19";
|
|
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.19";
|
|
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
|
}
|
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.19";
|
|
101282
101282
|
}
|
|
101283
101283
|
return "0.0.0";
|
|
101284
101284
|
}
|
|
@@ -152326,6 +152326,8 @@ function parseResolvedActivity(raw) {
|
|
|
152326
152326
|
if (/^android\/.*(Resolver|Chooser)Activity$/.test(last)) return null;
|
|
152327
152327
|
return last;
|
|
152328
152328
|
}
|
|
152329
|
+
var LAUNCHER = "android.intent.category.LAUNCHER";
|
|
152330
|
+
var LEANBACK_LAUNCHER = "android.intent.category.LEANBACK_LAUNCHER";
|
|
152329
152331
|
async function resolveLauncherActivity(udid, bundleId, isTv = false) {
|
|
152330
152332
|
let lastRaw = "";
|
|
152331
152333
|
const resolveFor = async (category) => {
|
|
@@ -152339,11 +152341,11 @@ async function resolveLauncherActivity(udid, bundleId, isTv = false) {
|
|
|
152339
152341
|
return parseResolvedActivity(raw);
|
|
152340
152342
|
};
|
|
152341
152343
|
if (isTv) {
|
|
152342
|
-
const leanback = await resolveFor(
|
|
152343
|
-
if (leanback) return leanback;
|
|
152344
|
+
const leanback = await resolveFor(LEANBACK_LAUNCHER);
|
|
152345
|
+
if (leanback) return { component: leanback, category: LEANBACK_LAUNCHER };
|
|
152344
152346
|
}
|
|
152345
152347
|
const launcher = await resolveFor();
|
|
152346
|
-
if (launcher) return launcher;
|
|
152348
|
+
if (launcher) return { component: launcher, category: LAUNCHER };
|
|
152347
152349
|
const pmPath = await adbShell(udid, `pm path ${shellQuote2(bundleId)}; true`);
|
|
152348
152350
|
throw new FailureError(
|
|
152349
152351
|
`Could not resolve a ${isTv ? "LEANBACK_LAUNCHER or LAUNCHER" : "LAUNCHER"} activity for ${bundleId}. ` + (pmPath.includes("package:") ? `It is installed but declares no such activity: pass an explicit \`activity\`. ` : `It is not installed on ${udid}: install it with \`reinstall-app\`. `) + `(resolve-activity output: ${lastRaw.trim() || "empty"})`,
|
|
@@ -152367,17 +152369,22 @@ async function followNativeNetworkCapture(udid, bundleId) {
|
|
|
152367
152369
|
return {};
|
|
152368
152370
|
}
|
|
152369
152371
|
}
|
|
152372
|
+
function launcherStartArgs(category) {
|
|
152373
|
+
return category ? ` -a android.intent.action.MAIN -c ${shellQuote2(category)}` : "";
|
|
152374
|
+
}
|
|
152370
152375
|
var androidImpl = {
|
|
152371
152376
|
requires: ["adb"],
|
|
152372
152377
|
handler: async (_services, params) => {
|
|
152373
152378
|
let component;
|
|
152379
|
+
let category = null;
|
|
152374
152380
|
if (params.activity) {
|
|
152375
152381
|
component = normalizeActivityComponent(params.bundleId, params.activity);
|
|
152376
152382
|
} else {
|
|
152377
152383
|
const isTv = await isAndroidTv(params.udid);
|
|
152378
|
-
component = await resolveLauncherActivity(params.udid, params.bundleId, isTv);
|
|
152384
|
+
({ component, category } = await resolveLauncherActivity(params.udid, params.bundleId, isTv));
|
|
152379
152385
|
}
|
|
152380
|
-
const
|
|
152386
|
+
const start2 = `am start -W${launcherStartArgs(category)} -n ${shellQuote2(component)}`;
|
|
152387
|
+
const out = await adbShell(params.udid, start2, {
|
|
152381
152388
|
timeoutMs: 3e4
|
|
152382
152389
|
});
|
|
152383
152390
|
assertAmStartOk(out);
|
|
@@ -152795,13 +152802,15 @@ var androidImpl2 = {
|
|
|
152795
152802
|
const { udid, bundleId, activity } = params;
|
|
152796
152803
|
await adbShell(udid, `am force-stop ${shellQuote2(bundleId)}`, { timeoutMs: 15e3 });
|
|
152797
152804
|
let component;
|
|
152805
|
+
let category = null;
|
|
152798
152806
|
if (activity) {
|
|
152799
152807
|
component = normalizeActivityComponent(bundleId, activity);
|
|
152800
152808
|
} else {
|
|
152801
152809
|
const isTv = await isAndroidTv(udid);
|
|
152802
|
-
component = await resolveLauncherActivity(udid, bundleId, isTv);
|
|
152810
|
+
({ component, category } = await resolveLauncherActivity(udid, bundleId, isTv));
|
|
152803
152811
|
}
|
|
152804
|
-
const
|
|
152812
|
+
const start2 = `am start -W${launcherStartArgs(category)} -n ${shellQuote2(component)}`;
|
|
152813
|
+
const out = await adbShell(udid, start2, {
|
|
152805
152814
|
timeoutMs: 3e4
|
|
152806
152815
|
});
|
|
152807
152816
|
try {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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.19",
|
|
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",
|