@swmansion/argent 0.27.1-next.14 → 0.27.1-next.15
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/client.d.ts +13 -4
- package/dist/installer.mjs +1 -1
- package/dist/tool-server.cjs +92 -22
- package/package.json +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -21916,7 +21916,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
21916
21916
|
var SESSION_ID2 = randomUUID5();
|
|
21917
21917
|
function readCliVersion() {
|
|
21918
21918
|
if (true) {
|
|
21919
|
-
return "0.27.1-next.
|
|
21919
|
+
return "0.27.1-next.15";
|
|
21920
21920
|
}
|
|
21921
21921
|
return "0.0.0";
|
|
21922
21922
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export interface UiTreeNode {
|
|
|
45
45
|
bundleId?: string;
|
|
46
46
|
editable?: boolean;
|
|
47
47
|
heading?: boolean;
|
|
48
|
-
/**
|
|
48
|
+
/** On screen, but behind an in-app presentation (iOS) or a system alert. */
|
|
49
49
|
covered?: boolean;
|
|
50
50
|
placeholder?: string;
|
|
51
51
|
/** The input shows its placeholder: it holds no text, and `value` is unset. */
|
|
@@ -62,14 +62,23 @@ export interface UiTree {
|
|
|
62
62
|
width: number;
|
|
63
63
|
height: number;
|
|
64
64
|
};
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* iOS: while a system alert shows, the system app first and the app it covers
|
|
67
|
+
* second. Android: one root per window, topmost first.
|
|
68
|
+
*/
|
|
66
69
|
roots: UiTreeNode[];
|
|
67
70
|
truncated: boolean;
|
|
68
71
|
alertVisible?: boolean;
|
|
69
72
|
keyboardVisible?: boolean;
|
|
70
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* The bundle id or package of the app in front, under any system alert.
|
|
75
|
+
* Android: unset when the alert hides the app's window.
|
|
76
|
+
*/
|
|
71
77
|
foregroundApp?: string;
|
|
72
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Fields this source cannot report. On Android they depend on the API level:
|
|
80
|
+
* `placeholder` and `hintShowing` need 26, `heading` 28.
|
|
81
|
+
*/
|
|
73
82
|
unsupportedFields: string[];
|
|
74
83
|
}
|
|
75
84
|
export interface CallToolOptions {
|
package/dist/installer.mjs
CHANGED
|
@@ -16730,7 +16730,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
16730
16730
|
var SESSION_ID = randomUUID4();
|
|
16731
16731
|
function readCliVersion() {
|
|
16732
16732
|
if (true) {
|
|
16733
|
-
return "0.27.1-next.
|
|
16733
|
+
return "0.27.1-next.15";
|
|
16734
16734
|
}
|
|
16735
16735
|
return "0.0.0";
|
|
16736
16736
|
}
|
package/dist/tool-server.cjs
CHANGED
|
@@ -94814,7 +94814,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
94814
94814
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
94815
94815
|
function readCliVersion() {
|
|
94816
94816
|
if (true) {
|
|
94817
|
-
return "0.27.1-next.
|
|
94817
|
+
return "0.27.1-next.15";
|
|
94818
94818
|
}
|
|
94819
94819
|
return "0.0.0";
|
|
94820
94820
|
}
|
|
@@ -136454,26 +136454,40 @@ async function queryAndroidFullHierarchy(registry2, device) {
|
|
|
136454
136454
|
}
|
|
136455
136455
|
|
|
136456
136456
|
// ../tool-server/src/tools/ui-tree/android.ts
|
|
136457
|
-
var
|
|
136457
|
+
var LEGACY_UNSUPPORTED_FIELDS2 = [
|
|
136458
136458
|
"placeholder",
|
|
136459
136459
|
"hintShowing",
|
|
136460
136460
|
"hidden",
|
|
136461
136461
|
"heading",
|
|
136462
136462
|
"keyboardVisible",
|
|
136463
|
-
"foregroundApp"
|
|
136463
|
+
"foregroundApp",
|
|
136464
|
+
"alertVisible"
|
|
136464
136465
|
];
|
|
136465
|
-
|
|
136466
|
+
var TYPE_APPLICATION = 1;
|
|
136467
|
+
var TYPE_INPUT_METHOD = 2;
|
|
136468
|
+
var TYPE_SYSTEM = 3;
|
|
136469
|
+
var SYSTEM_DIALOG_PACKAGES = /* @__PURE__ */ new Set([
|
|
136470
|
+
"com.android.packageinstaller",
|
|
136471
|
+
"com.google.android.packageinstaller",
|
|
136472
|
+
"com.android.permissioncontroller",
|
|
136473
|
+
"com.google.android.permissioncontroller",
|
|
136474
|
+
"com.android.systemui"
|
|
136475
|
+
]);
|
|
136476
|
+
var SYSTEM_SHEET_PACKAGES = /* @__PURE__ */ new Set(["android", "com.android.intentresolver"]);
|
|
136477
|
+
function mapNode(xml, screenW, screenH, isRoot, v2) {
|
|
136466
136478
|
const a = xml.attrs;
|
|
136467
136479
|
const type = a.class ?? "";
|
|
136468
136480
|
const password = attrIsTrue(a, "password");
|
|
136469
|
-
const
|
|
136481
|
+
const hintShowing = v2 && attrIsTrue(a, "showing-hint");
|
|
136482
|
+
const text = password || hintShowing ? "" : a.text ?? "";
|
|
136470
136483
|
const desc = a["content-desc"] ?? "";
|
|
136471
136484
|
const rect = parseUiAutomatorBounds(a.bounds ?? "");
|
|
136472
|
-
const
|
|
136485
|
+
const textInput = type.endsWith("EditText") || type.endsWith("AutoCompleteTextView");
|
|
136486
|
+
const editable = v2 ? attrIsTrue(a, "editable") || textInput && a.enabled === "false" : textInput;
|
|
136473
136487
|
const node = { role: deriveUiAutomatorRole(type), children: [] };
|
|
136474
136488
|
if (type) node.type = type;
|
|
136475
136489
|
if (text || desc) node.label = text || desc;
|
|
136476
|
-
if (editable && text) node.value = text;
|
|
136490
|
+
if ((editable || textInput) && text) node.value = text;
|
|
136477
136491
|
if (desc) node.contentDescription = desc;
|
|
136478
136492
|
if (a["resource-id"]) node.identifier = a["resource-id"];
|
|
136479
136493
|
if (isRoot && a.package) node.bundleId = a.package;
|
|
@@ -136491,31 +136505,87 @@ function mapNode(xml, screenW, screenH, isRoot) {
|
|
|
136491
136505
|
if (attrIsTrue(a, "checkable")) node.checked = attrIsTrue(a, "checked");
|
|
136492
136506
|
if (password) node.password = true;
|
|
136493
136507
|
if (editable) node.editable = true;
|
|
136508
|
+
if (v2) {
|
|
136509
|
+
if (a.hint) node.placeholder = a.hint;
|
|
136510
|
+
if (hintShowing) node.hintShowing = true;
|
|
136511
|
+
const empty2 = node.frame && (node.frame.width <= 0 || node.frame.height <= 0);
|
|
136512
|
+
if (a["visible-to-user"] === "false" || empty2) node.hidden = true;
|
|
136513
|
+
if (attrIsTrue(a, "heading")) node.heading = true;
|
|
136514
|
+
}
|
|
136494
136515
|
for (const child of xml.children) {
|
|
136495
|
-
if (child.tag === "node") node.children.push(mapNode(child, screenW, screenH, false));
|
|
136516
|
+
if (child.tag === "node") node.children.push(mapNode(child, screenW, screenH, false, v2));
|
|
136496
136517
|
}
|
|
136497
136518
|
return node;
|
|
136498
136519
|
}
|
|
136499
|
-
function
|
|
136500
|
-
|
|
136501
|
-
const
|
|
136502
|
-
|
|
136520
|
+
function onScreen(frame) {
|
|
136521
|
+
if (!frame) return false;
|
|
136522
|
+
const w = Math.min(frame.x + frame.width, 1) - Math.max(frame.x, 0);
|
|
136523
|
+
const h = Math.min(frame.y + frame.height, 1) - Math.max(frame.y, 0);
|
|
136524
|
+
return w > 0 && h > 0;
|
|
136525
|
+
}
|
|
136526
|
+
function fillsScreen(frame) {
|
|
136527
|
+
return !!frame && frame.x <= 0 && frame.x + frame.width >= 1 && frame.y <= 0.1;
|
|
136528
|
+
}
|
|
136529
|
+
function markCovered(node) {
|
|
136530
|
+
node.covered = true;
|
|
136531
|
+
for (const child of node.children) markCovered(child);
|
|
136532
|
+
}
|
|
136533
|
+
function adaptAndroidTree(capture, screen) {
|
|
136534
|
+
const { xml, truncated } = capture;
|
|
136535
|
+
const v2 = (capture.treeVersion ?? 1) >= 2;
|
|
136536
|
+
const windows = (parseUiAutomatorXml(xml)?.children ?? []).filter((c) => c.tag === "node");
|
|
136537
|
+
const roots = windows.map((c) => mapNode(c, screen.width, screen.height, true, v2));
|
|
136538
|
+
const tree = {
|
|
136503
136539
|
schemaVersion: 1,
|
|
136504
136540
|
source: "android-devtools",
|
|
136505
136541
|
screen: { width: screen.width, height: screen.height },
|
|
136506
136542
|
roots,
|
|
136507
136543
|
truncated,
|
|
136508
|
-
unsupportedFields:
|
|
136544
|
+
unsupportedFields: LEGACY_UNSUPPORTED_FIELDS2
|
|
136509
136545
|
};
|
|
136546
|
+
if (!v2) return tree;
|
|
136547
|
+
const unsupported = [];
|
|
136548
|
+
const sdk = capture.sdkInt ?? 0;
|
|
136549
|
+
if (sdk < 26) unsupported.push("placeholder", "hintShowing");
|
|
136550
|
+
if (sdk < 28) unsupported.push("heading");
|
|
136551
|
+
if (capture.captureMode === "active-window") {
|
|
136552
|
+
unsupported.push("keyboardVisible", "foregroundApp", "alertVisible");
|
|
136553
|
+
} else {
|
|
136554
|
+
let keyboard = false;
|
|
136555
|
+
let foreground;
|
|
136556
|
+
let alert = false;
|
|
136557
|
+
windows.forEach((w, i) => {
|
|
136558
|
+
const windowType = Number(w.attrs["window-type"]);
|
|
136559
|
+
const root = roots[i];
|
|
136560
|
+
if (windowType === TYPE_INPUT_METHOD && onScreen(root.frame)) keyboard = true;
|
|
136561
|
+
if (foreground !== void 0 || !root.bundleId) return;
|
|
136562
|
+
if (windowType === TYPE_SYSTEM && root.bundleId === "android") alert = true;
|
|
136563
|
+
if (windowType !== TYPE_APPLICATION) return;
|
|
136564
|
+
if (SYSTEM_SHEET_PACKAGES.has(root.bundleId) || SYSTEM_DIALOG_PACKAGES.has(root.bundleId) && !fillsScreen(root.frame)) {
|
|
136565
|
+
alert = true;
|
|
136566
|
+
} else foreground = i;
|
|
136567
|
+
});
|
|
136568
|
+
const unknown2 = truncated ? void 0 : false;
|
|
136569
|
+
tree.keyboardVisible = keyboard || unknown2;
|
|
136570
|
+
if (foreground !== void 0) tree.foregroundApp = roots[foreground].bundleId;
|
|
136571
|
+
tree.alertVisible = alert || (foreground === void 0 ? unknown2 : false);
|
|
136572
|
+
if (alert && foreground !== void 0) {
|
|
136573
|
+
for (let i = foreground; i < roots.length; i++) {
|
|
136574
|
+
if (roots[i].bundleId === tree.foregroundApp) markCovered(roots[i]);
|
|
136575
|
+
}
|
|
136576
|
+
}
|
|
136577
|
+
}
|
|
136578
|
+
tree.unsupportedFields = unsupported;
|
|
136579
|
+
return tree;
|
|
136510
136580
|
}
|
|
136511
136581
|
async function readAndroidUiTree(registry2, device) {
|
|
136512
136582
|
const ref = androidDevtoolsRef(device);
|
|
136513
136583
|
const devtools = await registry2.resolveService(ref.urn, ref.options);
|
|
136514
|
-
const [
|
|
136584
|
+
const [capture, size] = await Promise.all([
|
|
136515
136585
|
devtools.getHierarchy({ maxNodes: FLOW_MAX_NODES, clearCache: true }),
|
|
136516
136586
|
devtools.getScreenSize()
|
|
136517
136587
|
]);
|
|
136518
|
-
return adaptAndroidTree(
|
|
136588
|
+
return adaptAndroidTree(capture, size);
|
|
136519
136589
|
}
|
|
136520
136590
|
|
|
136521
136591
|
// ../tool-server/src/tools/ui-tree/index.ts
|
|
@@ -149916,12 +149986,12 @@ function wrapPreservingFailure(message, err) {
|
|
|
149916
149986
|
return signal ? new FailureError(message, signal, { cause }) : new Error(message, { cause });
|
|
149917
149987
|
}
|
|
149918
149988
|
function projectIosDeviceNode(node) {
|
|
149919
|
-
const
|
|
149989
|
+
const onScreen2 = node.frame.width > 0 && node.frame.height > 0;
|
|
149920
149990
|
return {
|
|
149921
149991
|
skip: false,
|
|
149922
149992
|
children: node.children,
|
|
149923
149993
|
// Off-screen text must not hoist.
|
|
149924
|
-
ownText:
|
|
149994
|
+
ownText: onScreen2 ? nodeText(node) : "",
|
|
149925
149995
|
leaf: { ...node, children: [] },
|
|
149926
149996
|
shield: Boolean(node.identifier),
|
|
149927
149997
|
// Scroll-clip inputs (see `flattenHoisting`), in the adapter's normalized
|
|
@@ -149956,12 +150026,12 @@ async function queryIosDeviceFlowTree(registry2, device) {
|
|
|
149956
150026
|
|
|
149957
150027
|
// ../tool-server/src/tools/flows/flow-chromium-tree.ts
|
|
149958
150028
|
function projectChromiumNode(node) {
|
|
149959
|
-
const
|
|
150029
|
+
const onScreen2 = node.frame.width > 0 && node.frame.height > 0;
|
|
149960
150030
|
const addressable = Boolean(
|
|
149961
150031
|
node.identifier || node.label || node.value || node.clickable || node.focused
|
|
149962
150032
|
);
|
|
149963
150033
|
let leaf = null;
|
|
149964
|
-
if (
|
|
150034
|
+
if (onScreen2 && addressable) {
|
|
149965
150035
|
leaf = { ...node, children: [] };
|
|
149966
150036
|
if (node.password) {
|
|
149967
150037
|
leaf.label = "[password]";
|
|
@@ -149974,7 +150044,7 @@ function projectChromiumNode(node) {
|
|
|
149974
150044
|
// Off-screen text must not hoist, or a text assert against an ancestor
|
|
149975
150045
|
// would pass on content the screen doesn't show. A password's text never
|
|
149976
150046
|
// bubbles up.
|
|
149977
|
-
ownText:
|
|
150047
|
+
ownText: onScreen2 && !node.password ? nodeText(node) : "",
|
|
149978
150048
|
leaf,
|
|
149979
150049
|
shield: Boolean(node.identifier) || node.password === true
|
|
149980
150050
|
};
|
|
@@ -150000,13 +150070,13 @@ async function queryChromiumTree(registry2, device) {
|
|
|
150000
150070
|
|
|
150001
150071
|
// ../tool-server/src/tools/flows/flow-vega-tree.ts
|
|
150002
150072
|
function projectVegaNode(node) {
|
|
150003
|
-
const
|
|
150073
|
+
const onScreen2 = node.frame.width > 0 && node.frame.height > 0;
|
|
150004
150074
|
return {
|
|
150005
150075
|
skip: false,
|
|
150006
150076
|
children: node.children,
|
|
150007
150077
|
// Off-screen text must not hoist, or a text assert against an ancestor
|
|
150008
150078
|
// would pass on content the screen doesn't show.
|
|
150009
|
-
ownText:
|
|
150079
|
+
ownText: onScreen2 ? nodeText(node) : "",
|
|
150010
150080
|
leaf: { ...node, children: [] },
|
|
150011
150081
|
shield: isAuthoredVegaTestId(node.identifier)
|
|
150012
150082
|
};
|
package/package.json
CHANGED