@swmansion/argent 0.34.1-next.83 → 0.34.1-next.84
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/tool-server.cjs +207 -40
- package/package.json +2 -2
package/dist/cli-cmds.mjs
CHANGED
|
@@ -36295,7 +36295,7 @@ function isCi(env = process.env) {
|
|
|
36295
36295
|
var SESSION_ID2 = randomUUID5();
|
|
36296
36296
|
function readCliVersion() {
|
|
36297
36297
|
if (true) {
|
|
36298
|
-
return "0.34.1-next.
|
|
36298
|
+
return "0.34.1-next.84";
|
|
36299
36299
|
}
|
|
36300
36300
|
return "0.0.0";
|
|
36301
36301
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -16995,7 +16995,7 @@ function isCi(env = process.env) {
|
|
|
16995
16995
|
var SESSION_ID = randomUUID4();
|
|
16996
16996
|
function readCliVersion() {
|
|
16997
16997
|
if (true) {
|
|
16998
|
-
return "0.34.1-next.
|
|
16998
|
+
return "0.34.1-next.84";
|
|
16999
16999
|
}
|
|
17000
17000
|
return "0.0.0";
|
|
17001
17001
|
}
|
package/dist/tool-server.cjs
CHANGED
|
@@ -72947,7 +72947,7 @@ function isCi(env = process.env) {
|
|
|
72947
72947
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
72948
72948
|
function readCliVersion() {
|
|
72949
72949
|
if (true) {
|
|
72950
|
-
return "0.34.1-next.
|
|
72950
|
+
return "0.34.1-next.84";
|
|
72951
72951
|
}
|
|
72952
72952
|
return "0.0.0";
|
|
72953
72953
|
}
|
|
@@ -94637,6 +94637,7 @@ var FIRST_FRAME_WAIT_MS = 6e3;
|
|
|
94637
94637
|
var FIRST_FRAME_POLL_MS = 250;
|
|
94638
94638
|
var COMMAND_ACK_TIMEOUT_MS = 5e3;
|
|
94639
94639
|
var EDGE_DOWN_ACK_TIMEOUT_MS = 35e3;
|
|
94640
|
+
var KEY_ACK_TIMEOUT_MS = 15e3;
|
|
94640
94641
|
var connections = /* @__PURE__ */ new Map();
|
|
94641
94642
|
var cmdId = 0;
|
|
94642
94643
|
function pendingIdNamedBy(conn, message) {
|
|
@@ -94647,6 +94648,22 @@ function pendingIdNamedBy(conn, message) {
|
|
|
94647
94648
|
}
|
|
94648
94649
|
return void 0;
|
|
94649
94650
|
}
|
|
94651
|
+
function releaseHeldKeys(conn) {
|
|
94652
|
+
const held = conn.heldKeys.splice(0).reverse();
|
|
94653
|
+
if (conn.ws.readyState !== wrapper_default.OPEN) return;
|
|
94654
|
+
for (const code of held) {
|
|
94655
|
+
conn.ws.send(JSON.stringify({ id: String(++cmdId), cmd: "key", code, direction: "Up" }));
|
|
94656
|
+
}
|
|
94657
|
+
}
|
|
94658
|
+
function trackHeldKey(conn, cmd) {
|
|
94659
|
+
if (cmd.cmd !== "key" || typeof cmd.code !== "number") return;
|
|
94660
|
+
if (cmd.direction === "Down") {
|
|
94661
|
+
conn.heldKeys.push(cmd.code);
|
|
94662
|
+
return;
|
|
94663
|
+
}
|
|
94664
|
+
const index = conn.heldKeys.lastIndexOf(cmd.code);
|
|
94665
|
+
if (index !== -1) conn.heldKeys.splice(index, 1);
|
|
94666
|
+
}
|
|
94650
94667
|
function failAllPending(conn, makeError) {
|
|
94651
94668
|
const entries = [...conn.pending.values()];
|
|
94652
94669
|
conn.pending.clear();
|
|
@@ -94682,7 +94699,7 @@ function getOrCreateConnection(api) {
|
|
|
94682
94699
|
}
|
|
94683
94700
|
const { host } = new URL(api.apiUrl);
|
|
94684
94701
|
const ws = new wrapper_default(`ws://${host}/ws`);
|
|
94685
|
-
const conn = { ws, pending: /* @__PURE__ */ new Map() };
|
|
94702
|
+
const conn = { ws, pending: /* @__PURE__ */ new Map(), heldKeys: [] };
|
|
94686
94703
|
ws.on("message", (data) => {
|
|
94687
94704
|
const text = Buffer.isBuffer(data) ? data.toString() : Array.isArray(data) ? Buffer.concat(data).toString() : Buffer.from(data).toString();
|
|
94688
94705
|
let ack;
|
|
@@ -94727,7 +94744,7 @@ function getOrCreateConnection(api) {
|
|
|
94727
94744
|
connections.set(key2, conn);
|
|
94728
94745
|
return conn;
|
|
94729
94746
|
}
|
|
94730
|
-
async function sendCommand(api, cmd) {
|
|
94747
|
+
async function sendCommand(api, cmd, options = {}) {
|
|
94731
94748
|
const cmdName = typeof cmd.cmd === "string" ? cmd.cmd : "unknown";
|
|
94732
94749
|
if ((cmd.cmd === "rotate" || cmd.cmd === "button") && api.deviceId) {
|
|
94733
94750
|
forgetUiOrientation(api.deviceId);
|
|
@@ -94742,7 +94759,7 @@ async function sendCommand(api, cmd) {
|
|
|
94742
94759
|
const warning = turnWarning !== void 0 && screenWarning !== void 0 ? `${screenWarning} ${turnWarning}` : screenWarning ?? turnWarning;
|
|
94743
94760
|
const id = String(++cmdId);
|
|
94744
94761
|
const payload = JSON.stringify({ id, ...targeted });
|
|
94745
|
-
const ackTimeoutMs = cmdName === "edgeTouch" && cmd.type === "Down" ? EDGE_DOWN_ACK_TIMEOUT_MS : COMMAND_ACK_TIMEOUT_MS;
|
|
94762
|
+
const ackTimeoutMs = options.ackTimeoutMs ?? (cmdName === "edgeTouch" && cmd.type === "Down" ? EDGE_DOWN_ACK_TIMEOUT_MS : COMMAND_ACK_TIMEOUT_MS);
|
|
94746
94763
|
await new Promise((resolve21, reject) => {
|
|
94747
94764
|
let done = false;
|
|
94748
94765
|
const settle3 = (err) => {
|
|
@@ -94771,14 +94788,18 @@ async function sendCommand(api, cmd) {
|
|
|
94771
94788
|
);
|
|
94772
94789
|
timer.unref?.();
|
|
94773
94790
|
const settleAndDropConnection = (err) => {
|
|
94791
|
+
releaseHeldKeys(conn);
|
|
94774
94792
|
settle3(err);
|
|
94775
94793
|
connections.delete(api.apiUrl);
|
|
94776
94794
|
conn.ws.close();
|
|
94777
94795
|
};
|
|
94778
94796
|
conn.pending.set(id, { settle: settle3, cmd: cmdName });
|
|
94779
|
-
const write = () =>
|
|
94780
|
-
|
|
94781
|
-
|
|
94797
|
+
const write = () => {
|
|
94798
|
+
trackHeldKey(conn, targeted);
|
|
94799
|
+
conn.ws.send(payload, (err) => {
|
|
94800
|
+
if (err) settle3(transportError(cmdName, api.apiUrl, err.message));
|
|
94801
|
+
});
|
|
94802
|
+
};
|
|
94782
94803
|
if (conn.ws.readyState === wrapper_default.OPEN) write();
|
|
94783
94804
|
else conn.ws.once("open", write);
|
|
94784
94805
|
});
|
|
@@ -97945,7 +97966,11 @@ async function buildRemoteInstance(device) {
|
|
|
97945
97966
|
// session refuses reports the same failure as a refused touch instead of a
|
|
97946
97967
|
// bare SDK error the caller cannot classify.
|
|
97947
97968
|
pressKey: async (direction, keyCode) => {
|
|
97948
|
-
await sendCommand(
|
|
97969
|
+
await sendCommand(
|
|
97970
|
+
api,
|
|
97971
|
+
{ cmd: "key", code: keyCode, direction },
|
|
97972
|
+
{ ackTimeoutMs: KEY_ACK_TIMEOUT_MS }
|
|
97973
|
+
);
|
|
97949
97974
|
},
|
|
97950
97975
|
transport
|
|
97951
97976
|
};
|
|
@@ -97971,7 +97996,7 @@ async function buildAttachedInstance(device, externalDevice) {
|
|
|
97971
97996
|
deviceId: device.id,
|
|
97972
97997
|
external: true,
|
|
97973
97998
|
pressKey: async (direction, code) => {
|
|
97974
|
-
await sendCommand(api, { cmd: "key", code, direction });
|
|
97999
|
+
await sendCommand(api, { cmd: "key", code, direction }, { ackTimeoutMs: KEY_ACK_TIMEOUT_MS });
|
|
97975
98000
|
},
|
|
97976
98001
|
streamUrl: externalDevice.simulatorServer.streamUrl
|
|
97977
98002
|
/** `transport: undefined`, so the WS + HTTP path is reused unchanged. */
|
|
@@ -98248,17 +98273,28 @@ var simulatorServerBlueprint = {
|
|
|
98248
98273
|
proc.on("error", (err) => {
|
|
98249
98274
|
events.emit("terminated", err);
|
|
98250
98275
|
});
|
|
98276
|
+
const api = {
|
|
98277
|
+
apiUrl,
|
|
98278
|
+
streamUrl,
|
|
98279
|
+
deviceId: device.id,
|
|
98280
|
+
/**
|
|
98281
|
+
* Over the WebSocket, not stdin: simulator-server never replies on
|
|
98282
|
+
* stdin, so a stdin write resolved at once and a stalled server let keys
|
|
98283
|
+
* pile up and land in a burst while `keyboard` reported them typed
|
|
98284
|
+
* (#2030). The ack holds each press until the server has taken it, and
|
|
98285
|
+
* a server that stops answering for KEY_ACK_TIMEOUT_MS fails the press
|
|
98286
|
+
* with SIMULATOR_COMMAND_ACK_TIMEOUT.
|
|
98287
|
+
*/
|
|
98288
|
+
pressKey: async (direction, keyCode) => {
|
|
98289
|
+
await sendCommand(
|
|
98290
|
+
api,
|
|
98291
|
+
{ cmd: "key", code: keyCode, direction },
|
|
98292
|
+
{ ackTimeoutMs: KEY_ACK_TIMEOUT_MS }
|
|
98293
|
+
);
|
|
98294
|
+
}
|
|
98295
|
+
};
|
|
98251
98296
|
const instance = {
|
|
98252
|
-
api
|
|
98253
|
-
apiUrl,
|
|
98254
|
-
streamUrl,
|
|
98255
|
-
deviceId: device.id,
|
|
98256
|
-
pressKey: (direction, keyCode) => {
|
|
98257
|
-
proc.stdin?.write(`key ${direction} ${keyCode}
|
|
98258
|
-
`);
|
|
98259
|
-
return Promise.resolve();
|
|
98260
|
-
}
|
|
98261
|
-
},
|
|
98297
|
+
api,
|
|
98262
98298
|
dispose: async () => {
|
|
98263
98299
|
proc.kill();
|
|
98264
98300
|
},
|
|
@@ -134840,6 +134876,7 @@ function charToKeyPress(char) {
|
|
|
134840
134876
|
// ../tool-server/src/tools/keyboard/simulator-server-keys.ts
|
|
134841
134877
|
init_capability();
|
|
134842
134878
|
var sleep10 = (ms3) => new Promise((r) => setTimeout(r, ms3));
|
|
134879
|
+
var KEY_HOLD = { ms: 20 };
|
|
134843
134880
|
async function typeSimulatorServer(registry2, device, params) {
|
|
134844
134881
|
const ref = simulatorServerRef(device);
|
|
134845
134882
|
const api = await registry2.resolveService(ref.urn, ref.options);
|
|
@@ -134851,7 +134888,7 @@ async function typeSimulatorServer(registry2, device, params) {
|
|
|
134851
134888
|
await sleep10(10);
|
|
134852
134889
|
}
|
|
134853
134890
|
await api.pressKey("Down", keyCode);
|
|
134854
|
-
await sleep10(
|
|
134891
|
+
await sleep10(KEY_HOLD.ms);
|
|
134855
134892
|
await api.pressKey("Up", keyCode);
|
|
134856
134893
|
if (withShift) {
|
|
134857
134894
|
await sleep10(10);
|
|
@@ -134890,6 +134927,127 @@ async function typeSimulatorServer(registry2, device, params) {
|
|
|
134890
134927
|
return { typed: params.text ?? params.key ?? "", keys: keysPressed };
|
|
134891
134928
|
}
|
|
134892
134929
|
|
|
134930
|
+
// ../tool-server/src/tools/keyboard/ios-readback.ts
|
|
134931
|
+
var READBACK_TIMING = {
|
|
134932
|
+
/** Budget to reach the ax-service; past it, typing goes on unchecked. */
|
|
134933
|
+
resolveMs: 1500,
|
|
134934
|
+
/**
|
|
134935
|
+
* Budget for each tree read. Before typing, past it the typing goes on
|
|
134936
|
+
* unchecked; after typing, the ax-service check decides.
|
|
134937
|
+
*/
|
|
134938
|
+
treeMs: 1500,
|
|
134939
|
+
/**
|
|
134940
|
+
* Budget for the ax-service check after typing. It must outlast the
|
|
134941
|
+
* daemon's 1 s wait, or a field that does not hold the text never answers
|
|
134942
|
+
* "no". The daemon's wait also gives an app that applies input late the
|
|
134943
|
+
* time it needs.
|
|
134944
|
+
*/
|
|
134945
|
+
checkMs: 3500
|
|
134946
|
+
};
|
|
134947
|
+
var FOCUS_MOVING = /[\r\n\t]/;
|
|
134948
|
+
var READBACK_MISMATCH_WARNING = "After typing, the focused field does not hold the text that was sent. Keys may have been dropped or repeated (a stalled simulator does this, and the keys were still acknowledged), or the app or iOS changed the text (auto-capitalization, auto-correction, an input formatter, a length limit). Read the field before submitting; to retype, clear it first.";
|
|
134949
|
+
async function within(ms3, run2) {
|
|
134950
|
+
let timer;
|
|
134951
|
+
try {
|
|
134952
|
+
return await Promise.race([
|
|
134953
|
+
// Through `then`, so a synchronous throw is caught as well.
|
|
134954
|
+
Promise.resolve().then(run2).catch(() => void 0),
|
|
134955
|
+
new Promise((resolve21) => {
|
|
134956
|
+
timer = setTimeout(() => resolve21(void 0), ms3);
|
|
134957
|
+
timer.unref?.();
|
|
134958
|
+
})
|
|
134959
|
+
]);
|
|
134960
|
+
} finally {
|
|
134961
|
+
clearTimeout(timer);
|
|
134962
|
+
}
|
|
134963
|
+
}
|
|
134964
|
+
async function typeWithReadback(registry2, device, text, type) {
|
|
134965
|
+
if (!text || FOCUS_MOVING.test(text)) return { result: await type() };
|
|
134966
|
+
const ax = await within(READBACK_TIMING.resolveMs, async () => {
|
|
134967
|
+
const ref = axServiceRef(device);
|
|
134968
|
+
const api = await registry2.resolveService(ref.urn, ref.options);
|
|
134969
|
+
return api.degraded ? void 0 : api;
|
|
134970
|
+
});
|
|
134971
|
+
const readTree = async () => ax ? (await within(READBACK_TIMING.treeMs, () => ax.tree()))?.nodes : void 0;
|
|
134972
|
+
const before = await readTree();
|
|
134973
|
+
const field2 = before && focusedInput(before);
|
|
134974
|
+
const typedInto = field2 && heldText(field2) === "" ? field2 : void 0;
|
|
134975
|
+
const result = await type();
|
|
134976
|
+
if (!ax || !typedInto) return { result };
|
|
134977
|
+
const judge = async () => {
|
|
134978
|
+
const nodes = await readTree();
|
|
134979
|
+
return nodes ? judgeTree(nodes, typedInto, text) : "unread";
|
|
134980
|
+
};
|
|
134981
|
+
const verified = { result, readback: { verified: true } };
|
|
134982
|
+
const early = await judge();
|
|
134983
|
+
if (early === "holds") return verified;
|
|
134984
|
+
if (early === "moved") return { result };
|
|
134985
|
+
const after = await within(READBACK_TIMING.checkMs, () => ax.fill(text, { check: true }));
|
|
134986
|
+
if (after?.verified) return verified;
|
|
134987
|
+
if (!after || !after.focused || after.timedOut) return { result };
|
|
134988
|
+
const late = await judge();
|
|
134989
|
+
if (late === "holds") return verified;
|
|
134990
|
+
if (late === "moved" || late === "unread") return { result };
|
|
134991
|
+
return { result, readback: { verified: false, warning: READBACK_MISMATCH_WARNING } };
|
|
134992
|
+
}
|
|
134993
|
+
function judgeTree(nodes, typedInto, text) {
|
|
134994
|
+
const focused = focusedInput(nodes);
|
|
134995
|
+
if (!focused || !sameInput(focused, typedInto)) return "moved";
|
|
134996
|
+
const held = heldText(focused);
|
|
134997
|
+
return held !== void 0 && holdsTyped(text, held) ? "holds" : void 0;
|
|
134998
|
+
}
|
|
134999
|
+
var SECURE_TEXT_FIELD = 50;
|
|
135000
|
+
var TEXT_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
135001
|
+
45,
|
|
135002
|
+
49,
|
|
135003
|
+
SECURE_TEXT_FIELD,
|
|
135004
|
+
52
|
|
135005
|
+
]);
|
|
135006
|
+
function focusedInput(nodes) {
|
|
135007
|
+
return nodes.find(
|
|
135008
|
+
(node2) => node2.traits?.includes("isEditing") && node2.elementType !== void 0 && TEXT_INPUT_TYPES.has(node2.elementType)
|
|
135009
|
+
);
|
|
135010
|
+
}
|
|
135011
|
+
function heldText(node2) {
|
|
135012
|
+
if (node2.hintShowing) return "";
|
|
135013
|
+
if (node2.elementType === SECURE_TEXT_FIELD) return node2.value ? void 0 : "";
|
|
135014
|
+
return node2.value ?? "";
|
|
135015
|
+
}
|
|
135016
|
+
function sameInput(a, b) {
|
|
135017
|
+
if (a.elementType !== b.elementType) return false;
|
|
135018
|
+
if (!a.frame || !b.frame) return true;
|
|
135019
|
+
const [p, q] = [a.frame, b.frame];
|
|
135020
|
+
const width = Math.min(p.x + p.width, q.x + q.width) - Math.max(p.x, q.x);
|
|
135021
|
+
const height = Math.min(p.y + p.height, q.y + q.height) - Math.max(p.y, q.y);
|
|
135022
|
+
if (width <= 0 || height <= 0) return false;
|
|
135023
|
+
const smaller = Math.min(p.width * p.height, q.width * q.height);
|
|
135024
|
+
return width * height >= smaller / 2;
|
|
135025
|
+
}
|
|
135026
|
+
function holdsTyped(typed, held) {
|
|
135027
|
+
const a = plainPunctuation(typed);
|
|
135028
|
+
const b = plainPunctuation(held);
|
|
135029
|
+
return a === b || capitalizedByIos(a, b);
|
|
135030
|
+
}
|
|
135031
|
+
function plainPunctuation(text) {
|
|
135032
|
+
return text.replace(/‹[\u00A0\u202F]?|[\u00A0\u202F]?›/gu, "'").replace(/«[\u00A0\u202F]?|[\u00A0\u202F]?»/gu, '"').replace(/[‘’‚‛]/gu, "'").replace(/[“”„‟]/gu, '"').replace(/--|–/gu, "\u2014");
|
|
135033
|
+
}
|
|
135034
|
+
var WORD_OPENER = /[\s"'([{¿¡]/u;
|
|
135035
|
+
function capitalizedByIos(typed, held) {
|
|
135036
|
+
const a = Array.from(typed);
|
|
135037
|
+
const b = Array.from(held);
|
|
135038
|
+
if (a.length !== b.length) return false;
|
|
135039
|
+
let changed = false;
|
|
135040
|
+
for (let i = 0; i < a.length; i++) {
|
|
135041
|
+
const char = a[i];
|
|
135042
|
+
if (char === b[i]) continue;
|
|
135043
|
+
const wordStart = i === 0 || WORD_OPENER.test(a[i - 1]);
|
|
135044
|
+
const lowercase2 = char !== char.toUpperCase();
|
|
135045
|
+
if (!wordStart || !lowercase2 || b[i] !== char.toUpperCase()) return false;
|
|
135046
|
+
changed = true;
|
|
135047
|
+
}
|
|
135048
|
+
return changed;
|
|
135049
|
+
}
|
|
135050
|
+
|
|
134893
135051
|
// ../tool-server/src/tools/keyboard/platforms/tv.ts
|
|
134894
135052
|
init_capability();
|
|
134895
135053
|
async function typeTv(registry2, device, params) {
|
|
@@ -134909,14 +135067,23 @@ async function typeTv(registry2, device, params) {
|
|
|
134909
135067
|
}
|
|
134910
135068
|
|
|
134911
135069
|
// ../tool-server/src/tools/keyboard/platforms/ios.ts
|
|
135070
|
+
async function typeAndReadBack(registry2, device, params) {
|
|
135071
|
+
const { result, readback } = await typeWithReadback(
|
|
135072
|
+
registry2,
|
|
135073
|
+
device,
|
|
135074
|
+
params.text ?? "",
|
|
135075
|
+
() => typeSimulatorServer(registry2, device, params)
|
|
135076
|
+
);
|
|
135077
|
+
return readback ? { ...result, ...readback } : result;
|
|
135078
|
+
}
|
|
134912
135079
|
function makeIosImpl3(registry2) {
|
|
134913
135080
|
return {
|
|
134914
|
-
handler: async (_services, params, device) => await isTvOsSimulator(device.id) ? typeTv(registry2, device, params) :
|
|
135081
|
+
handler: async (_services, params, device) => await isTvOsSimulator(device.id) ? typeTv(registry2, device, params) : typeAndReadBack(registry2, device, params)
|
|
134915
135082
|
};
|
|
134916
135083
|
}
|
|
134917
135084
|
function makeIosRemoteImpl(registry2) {
|
|
134918
135085
|
return {
|
|
134919
|
-
handler: async (_services, params, device) =>
|
|
135086
|
+
handler: async (_services, params, device) => typeAndReadBack(registry2, device, params)
|
|
134920
135087
|
};
|
|
134921
135088
|
}
|
|
134922
135089
|
|
|
@@ -135423,7 +135590,7 @@ function createKeyboardTool(registry2) {
|
|
|
135423
135590
|
description: `Type text or press special keys on the device (iOS simulator, Android emulator or device, <flag:harmonyos>HarmonyOS device, </flag:harmonyos>Chromium app, <flag:macos-apps>Mac app, </flag:macos-apps>Vega Virtual Device, or Apple TV / Android TV) using keyboard events.
|
|
135424
135591
|
Use when you need to enter text or trigger a named key such as enter, escape, or arrow keys. On Vega and Apple TV / Android TV, prefer the remote tools for D-pad navigation; focus a text field with \`tv-remote\` first (e.g. a search or login box), then type into it with keyboard.
|
|
135425
135592
|
Tap the field first: with no focus the text is dropped and the call still succeeds.
|
|
135426
|
-
Returns { typed: string, keys: number }. On physical iOS, reactivated: true = app was re-fronted; re-describe. Fails if an unsupported key name is provided (rejected before anything is sent) or if the device's input backend is not reachable.
|
|
135593
|
+
Returns { typed: string, keys: number }. On physical iOS, reactivated: true = app was re-fronted; re-describe. On an iOS simulator, when the focused field was empty before typing, the field is read back: verified: true = it holds the typed text, though iOS may have capitalized the first letter of a word or curled a quote; no verified = the field was not checked: it held text before typing, the text has a Return or Tab, focus moved to another field while typing, or the field could not be read in time (the app busy, the accessibility service missing or slow); verified: false comes with a warning (keys dropped or repeated, or the app or iOS changed the text), so read the field before submitting. Fails if an unsupported key name is provided (rejected before anything is sent) or if the device's input backend is not reachable.
|
|
135427
135594
|
A failure is not rolled back. Un-typeable text is rejected mid-string on the iOS simulator and Chromium, leaving the characters before it in the field (Android, <flag:harmonyos>HarmonyOS, </flag:harmonyos>Vega and TV targets check the whole string up front).<flag:macos-apps> A Mac app types any character.</flag:macos-apps> A transport failure partway also leaves the text already sent. On a retry, read the field's actual contents; do not assume it is unchanged.
|
|
135428
135595
|
React Native: after typing, the next tap outside the field may only close the keyboard. If only the keyboard closed, tap again; where the field submits on return, \`key: "enter"\` avoids the extra tap.`,
|
|
135429
135596
|
zodSchema: zodSchema26,
|
|
@@ -158251,8 +158418,8 @@ function selectorToYaml(sel) {
|
|
|
158251
158418
|
if (sel.loose && sel.text !== void 0 && sel.identifier === void 0 && sel.role === void 0) {
|
|
158252
158419
|
return sel.text;
|
|
158253
158420
|
}
|
|
158254
|
-
const { loose: _loose, any: any2, identifier, textMatches: textMatches2, within, after, next, ...rest } = sel;
|
|
158255
|
-
const scopes = { within, after, next };
|
|
158421
|
+
const { loose: _loose, any: any2, identifier, textMatches: textMatches2, within: within2, after, next, ...rest } = sel;
|
|
158422
|
+
const scopes = { within: within2, after, next };
|
|
158256
158423
|
const out = { ...rest };
|
|
158257
158424
|
if (any2) out.any = true;
|
|
158258
158425
|
if (textMatches2 !== void 0) out.text = { matches: textMatches2 };
|
|
@@ -158278,8 +158445,8 @@ function escapeInline(value) {
|
|
|
158278
158445
|
);
|
|
158279
158446
|
}
|
|
158280
158447
|
function describeSelector(s) {
|
|
158281
|
-
const { loose: _loose, any: any2, within, after, next, ...rest } = s;
|
|
158282
|
-
const scopes = { within, after, next };
|
|
158448
|
+
const { loose: _loose, any: any2, within: within2, after, next, ...rest } = s;
|
|
158449
|
+
const scopes = { within: within2, after, next };
|
|
158283
158450
|
const fields = Object.entries(rest).map(
|
|
158284
158451
|
([k, v]) => k === "textMatches" ? `text=/${escapeInline(String(v))}/` : `${k === "identifier" ? "id" : k}=${JSON.stringify(String(v))}`
|
|
158285
158452
|
).join(" ");
|
|
@@ -161446,8 +161613,8 @@ function probeWhenCondition(env, cond) {
|
|
|
161446
161613
|
return waitForCondition(env, cond, DEFAULT_ASSERT_TIMEOUT_MS);
|
|
161447
161614
|
}
|
|
161448
161615
|
function selectorAlternatives(sel) {
|
|
161449
|
-
const { loose, any: _any2, within, after, next, ...own2 } = sel;
|
|
161450
|
-
const scopes = { within, after, next };
|
|
161616
|
+
const { loose, any: _any2, within: within2, after, next, ...own2 } = sel;
|
|
161617
|
+
const scopes = { within: within2, after, next };
|
|
161451
161618
|
let alts = loose && own2.text !== void 0 ? [{ identifier: own2.text }, { text: own2.text }] : [own2];
|
|
161452
161619
|
for (const relation of SELECTOR_RELATIONS) {
|
|
161453
161620
|
const scope = scopes[relation];
|
|
@@ -161639,7 +161806,7 @@ async function scrollIncrement(env, direction, region, limit = Infinity, anchor2
|
|
|
161639
161806
|
throw err;
|
|
161640
161807
|
}
|
|
161641
161808
|
}
|
|
161642
|
-
async function scrollToVisible(env, target, direction,
|
|
161809
|
+
async function scrollToVisible(env, target, direction, within2) {
|
|
161643
161810
|
let prevFp;
|
|
161644
161811
|
let prevShown;
|
|
161645
161812
|
let anchorSpent = false;
|
|
@@ -161648,9 +161815,9 @@ async function scrollToVisible(env, target, direction, within) {
|
|
|
161648
161815
|
if (env.signal?.aborted) return { aborted: true };
|
|
161649
161816
|
const tree = await settleTree(env);
|
|
161650
161817
|
if (!tree) return { aborted: true };
|
|
161651
|
-
const container =
|
|
161652
|
-
if (
|
|
161653
|
-
return { reason: `scroll container ${describeSelector(
|
|
161818
|
+
const container = within2 ? flowSelectorToNode(tree, within2) : void 0;
|
|
161819
|
+
if (within2 && !container) {
|
|
161820
|
+
return { reason: `scroll container ${describeSelector(within2)} is not visible` };
|
|
161654
161821
|
}
|
|
161655
161822
|
const targetNode = flowSelectorToNode(tree, target);
|
|
161656
161823
|
const frame2 = targetNode?.frame;
|
|
@@ -161671,7 +161838,7 @@ async function scrollToVisible(env, target, direction, within) {
|
|
|
161671
161838
|
anchorSpent = spentNow = true;
|
|
161672
161839
|
}
|
|
161673
161840
|
prevShown = shown;
|
|
161674
|
-
const scope =
|
|
161841
|
+
const scope = within2 ? [region] : anchorScrollFrames(tree, getDescribeTapPoint(region));
|
|
161675
161842
|
if (scope.length === 0) scope.push(FULL_SCREEN2);
|
|
161676
161843
|
const fp = treeFingerprint(tree, (node2) => scope.some((r) => framesOverlap(node2.frame, r)));
|
|
161677
161844
|
if (!spentNow && prevFp !== void 0 && fp === prevFp) {
|
|
@@ -161694,7 +161861,7 @@ async function scrollToVisible(env, target, direction, within) {
|
|
|
161694
161861
|
if (!(err instanceof Error && NO_SCROLLABLE_VIEW.test(err.message))) throw err;
|
|
161695
161862
|
if (frame2) return { frame: frame2, ...warnedBy(warning) };
|
|
161696
161863
|
return {
|
|
161697
|
-
reason: `nothing scrolls at the centre of ${
|
|
161864
|
+
reason: `nothing scrolls at the centre of ${within2 ? describeSelector(within2) : "the screen"}, so ${describeSelector(target)} cannot be scrolled into view; name its scroll container in within:`,
|
|
161698
161865
|
...warnedBy(warning)
|
|
161699
161866
|
};
|
|
161700
161867
|
}
|
|
@@ -167949,9 +168116,9 @@ async function runSnapshot(env, opts) {
|
|
|
167949
168116
|
}
|
|
167950
168117
|
};
|
|
167951
168118
|
}
|
|
167952
|
-
const
|
|
167953
|
-
const reason2 = `diff ${result.mismatchPercentage.toFixed(2)}% ${
|
|
167954
|
-
if (
|
|
168119
|
+
const within2 = result.mismatchPercentage <= opts.maxMismatch * (1 + 1e-14);
|
|
168120
|
+
const reason2 = `diff ${result.mismatchPercentage.toFixed(2)}% ${within2 ? "\u2264" : ">"} ${opts.maxMismatch}% (${key2})`;
|
|
168121
|
+
if (within2) {
|
|
167955
168122
|
return { status: "pass", reason: reason2, ...captureWarned };
|
|
167956
168123
|
}
|
|
167957
168124
|
const artifacts = {
|
|
@@ -168446,9 +168613,9 @@ function displayFlowName(params) {
|
|
|
168446
168613
|
const stem = params.e2e_test_path === void 0 ? void 0 : path66.basename(params.e2e_test_path, ".yaml");
|
|
168447
168614
|
return params.name || stem || params.e2e_test_path || "(unspecified)";
|
|
168448
168615
|
}
|
|
168449
|
-
function* walkSteps(steps,
|
|
168616
|
+
function* walkSteps(steps, within2 = "") {
|
|
168450
168617
|
for (const [i, step] of steps.entries()) {
|
|
168451
|
-
const where = `step ${i + 1}${
|
|
168618
|
+
const where = `step ${i + 1}${within2}`;
|
|
168452
168619
|
yield { step, where };
|
|
168453
168620
|
const inner = blockSteps(step);
|
|
168454
168621
|
if (inner) yield* walkSteps(inner, ` of the ${step.kind}: block at ${where}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.34.1-next.
|
|
3
|
+
"version": "0.34.1-next.84",
|
|
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",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"vitest": "^5.0.5",
|
|
99
99
|
"yaml": "^2.9.1"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "e952ba7dc326a7f7ca21f385fc5a786335f75424"
|
|
102
102
|
}
|