MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / resolveKnownSystemPromptsWithQueries

Function resolveKnownSystemPromptsWithQueries

scripts/integration/cli.mjs:1270–1325  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

1268}
1269
1270async function resolveKnownSystemPromptsWithQueries(label) {
1271 const prompts = [{ kind: "open-url", selector: { label: "Open" } }];
1272 for (const prompt of prompts) {
1273 const result = await queryUi(label, {
1274 selector: prompt.selector,
1275 limit: 1,
1276 maxDepth: 6,
1277 maxElapsedMs: httpActionBudgetMs,
1278 });
1279 if (!result.matches?.length) {
1280 continue;
1281 }
1282 logStep(`handling system ${prompt.kind} prompt after ${label}`);
1283 await retryHttpJson(
1284 "POST",
1285 `/api/simulators/${simulatorUDID}/action`,
1286 {
1287 action: "tap",
1288 source: "native-ax",
1289 maxDepth: 6,
1290 waitTimeoutMs: 2_000,
1291 durationMs: 80,
1292 selector: prompt.selector,
1293 },
1294 `${label} tap ${prompt.kind} prompt`,
1295 { attempts: 1, maxElapsedMs: httpActionBudgetMs },
1296 );
1297 await sleep(500);
1298 }
1299
1300 const snapshot = await queryUi(label, {
1301 limit: 128,
1302 maxDepth: 8,
1303 maxElapsedMs: httpActionBudgetMs,
1304 });
1305 if (!looksLikeKeyboardTipQuery(snapshot)) {
1306 return;
1307 }
1308
1309 logStep(`handling system keyboard-tip prompt after ${label}`);
1310 await retryHttpJson(
1311 "POST",
1312 `/api/simulators/${simulatorUDID}/action`,
1313 {
1314 action: "tap",
1315 source: "native-ax",
1316 maxDepth: 8,
1317 waitTimeoutMs: 2_000,
1318 durationMs: 80,
1319 ...keyboardTipContinueTapTarget(snapshot),
1320 },
1321 `${label} tap keyboard-tip prompt`,
1322 { attempts: 1, maxElapsedMs: httpActionBudgetMs },
1323 );
1324 await sleep(500);
1325}
1326
1327function summarizeUiCheck(options = {}) {

Callers 1

verifyUiFunction · 0.85

Calls 6

queryUiFunction · 0.85
logStepFunction · 0.85
retryHttpJsonFunction · 0.85
sleepFunction · 0.70

Tested by

no test coverage detected