react-native-ai-debugger 1.8.0 → 1.9.0
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/README.md +73 -66
- package/build/__tests__/integration/auto-reconnect.test.d.ts +2 -0
- package/build/__tests__/integration/auto-reconnect.test.d.ts.map +1 -0
- package/build/__tests__/integration/auto-reconnect.test.js +118 -0
- package/build/__tests__/integration/auto-reconnect.test.js.map +1 -0
- package/build/__tests__/integration/per-call-timeout.test.d.ts +2 -0
- package/build/__tests__/integration/per-call-timeout.test.d.ts.map +1 -0
- package/build/__tests__/integration/per-call-timeout.test.js +103 -0
- package/build/__tests__/integration/per-call-timeout.test.js.map +1 -0
- package/build/__tests__/setup.js +3 -5
- package/build/__tests__/setup.js.map +1 -1
- package/build/__tests__/unit/debugGlobals.test.d.ts +2 -0
- package/build/__tests__/unit/debugGlobals.test.d.ts.map +1 -0
- package/build/__tests__/unit/debugGlobals.test.js +14 -0
- package/build/__tests__/unit/debugGlobals.test.js.map +1 -0
- package/build/__tests__/unit/escapeNonAscii.test.d.ts +2 -0
- package/build/__tests__/unit/escapeNonAscii.test.d.ts.map +1 -0
- package/build/__tests__/unit/escapeNonAscii.test.js +76 -0
- package/build/__tests__/unit/escapeNonAscii.test.js.map +1 -0
- package/build/__tests__/unit/executor.test.js +59 -7
- package/build/__tests__/unit/executor.test.js.map +1 -1
- package/build/__tests__/unit/fastRefreshRecorder.test.d.ts +2 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.d.ts.map +1 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.js +68 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.js.map +1 -0
- package/build/__tests__/unit/fastRefreshTools.test.d.ts +2 -0
- package/build/__tests__/unit/fastRefreshTools.test.d.ts.map +1 -0
- package/build/__tests__/unit/fastRefreshTools.test.js +112 -0
- package/build/__tests__/unit/fastRefreshTools.test.js.map +1 -0
- package/build/__tests__/unit/fingerprint.test.js +10 -0
- package/build/__tests__/unit/fingerprint.test.js.map +1 -1
- package/build/__tests__/unit/measureComponent.test.d.ts +2 -0
- package/build/__tests__/unit/measureComponent.test.d.ts.map +1 -0
- package/build/__tests__/unit/measureComponent.test.js +66 -0
- package/build/__tests__/unit/measureComponent.test.js.map +1 -0
- package/build/__tests__/unit/measureComponentTools.test.d.ts +2 -0
- package/build/__tests__/unit/measureComponentTools.test.d.ts.map +1 -0
- package/build/__tests__/unit/measureComponentTools.test.js +94 -0
- package/build/__tests__/unit/measureComponentTools.test.js.map +1 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.d.ts +2 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.d.ts.map +1 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.js +29 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.js.map +1 -0
- package/build/__tests__/unit/timeoutClamp.test.d.ts +2 -0
- package/build/__tests__/unit/timeoutClamp.test.d.ts.map +1 -0
- package/build/__tests__/unit/timeoutClamp.test.js +17 -0
- package/build/__tests__/unit/timeoutClamp.test.js.map +1 -0
- package/build/__tests__/unit/transportClassify.test.d.ts +2 -0
- package/build/__tests__/unit/transportClassify.test.d.ts.map +1 -0
- package/build/__tests__/unit/transportClassify.test.js +60 -0
- package/build/__tests__/unit/transportClassify.test.js.map +1 -0
- package/build/core/appDetection.d.ts +7 -0
- package/build/core/appDetection.d.ts.map +1 -1
- package/build/core/appDetection.js +38 -17
- package/build/core/appDetection.js.map +1 -1
- package/build/core/bundle.d.ts +1 -1
- package/build/core/bundle.d.ts.map +1 -1
- package/build/core/bundle.js +6 -10
- package/build/core/bundle.js.map +1 -1
- package/build/core/componentSearch.d.ts +41 -0
- package/build/core/componentSearch.d.ts.map +1 -0
- package/build/core/componentSearch.js +484 -0
- package/build/core/componentSearch.js.map +1 -0
- package/build/core/componentTree.d.ts +13 -0
- package/build/core/componentTree.d.ts.map +1 -0
- package/build/core/componentTree.js +275 -0
- package/build/core/componentTree.js.map +1 -0
- package/build/core/connection.d.ts +1 -0
- package/build/core/connection.d.ts.map +1 -1
- package/build/core/connection.js +97 -88
- package/build/core/connection.js.map +1 -1
- package/build/core/debugGlobals.d.ts +6 -0
- package/build/core/debugGlobals.d.ts.map +1 -0
- package/build/core/debugGlobals.js +336 -0
- package/build/core/debugGlobals.js.map +1 -0
- package/build/core/escapeNonAscii.d.ts +18 -0
- package/build/core/escapeNonAscii.d.ts.map +1 -0
- package/build/core/escapeNonAscii.js +352 -0
- package/build/core/escapeNonAscii.js.map +1 -0
- package/build/core/executor.d.ts +7 -206
- package/build/core/executor.d.ts.map +1 -1
- package/build/core/executor.js +10 -4333
- package/build/core/executor.js.map +1 -1
- package/build/core/fastRefreshRecorder.d.ts +23 -0
- package/build/core/fastRefreshRecorder.d.ts.map +1 -0
- package/build/core/fastRefreshRecorder.js +83 -0
- package/build/core/fastRefreshRecorder.js.map +1 -0
- package/build/core/fastRefreshTools.d.ts +19 -0
- package/build/core/fastRefreshTools.d.ts.map +1 -0
- package/build/core/fastRefreshTools.js +71 -0
- package/build/core/fastRefreshTools.js.map +1 -0
- package/build/core/guides.d.ts.map +1 -1
- package/build/core/guides.js +2 -1
- package/build/core/guides.js.map +1 -1
- package/build/core/index.d.ts +5 -2
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +5 -2
- package/build/core/index.js.map +1 -1
- package/build/core/inspector.d.ts +50 -0
- package/build/core/inspector.d.ts.map +1 -0
- package/build/core/inspector.js +604 -0
- package/build/core/inspector.js.map +1 -0
- package/build/core/jsExecute.d.ts +61 -0
- package/build/core/jsExecute.d.ts.map +1 -0
- package/build/core/jsExecute.js +679 -0
- package/build/core/jsExecute.js.map +1 -0
- package/build/core/measureComponent.d.ts +19 -0
- package/build/core/measureComponent.d.ts.map +1 -0
- package/build/core/measureComponent.js +94 -0
- package/build/core/measureComponent.js.map +1 -0
- package/build/core/measureComponentTools.d.ts +6 -0
- package/build/core/measureComponentTools.d.ts.map +1 -0
- package/build/core/measureComponentTools.js +43 -0
- package/build/core/measureComponentTools.js.map +1 -0
- package/build/core/pressables.d.ts +44 -0
- package/build/core/pressables.d.ts.map +1 -0
- package/build/core/pressables.js +1480 -0
- package/build/core/pressables.js.map +1 -0
- package/build/core/register.d.ts +8 -0
- package/build/core/register.d.ts.map +1 -0
- package/build/core/register.js +216 -0
- package/build/core/register.js.map +1 -0
- package/build/core/rnGlobalsBootstrap.d.ts +16 -0
- package/build/core/rnGlobalsBootstrap.d.ts.map +1 -0
- package/build/core/rnGlobalsBootstrap.js +101 -0
- package/build/core/rnGlobalsBootstrap.js.map +1 -0
- package/build/core/screenLayout.d.ts +53 -0
- package/build/core/screenLayout.d.ts.map +1 -0
- package/build/core/screenLayout.js +828 -0
- package/build/core/screenLayout.js.map +1 -0
- package/build/core/state.d.ts +2 -2
- package/build/core/state.d.ts.map +1 -1
- package/build/core/state.js +10 -5
- package/build/core/state.js.map +1 -1
- package/build/core/telemetry.d.ts +23 -0
- package/build/core/telemetry.d.ts.map +1 -1
- package/build/core/telemetry.js +67 -0
- package/build/core/telemetry.js.map +1 -1
- package/build/core/toolHelpers.d.ts +24 -0
- package/build/core/toolHelpers.d.ts.map +1 -0
- package/build/core/toolHelpers.js +118 -0
- package/build/core/toolHelpers.js.map +1 -0
- package/build/core/types.d.ts +18 -6
- package/build/core/types.d.ts.map +1 -1
- package/build/index.d.ts +2 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +37 -4440
- package/build/index.js.map +1 -1
- package/build/tools/accountTools.d.ts +2 -0
- package/build/tools/accountTools.d.ts.map +1 -1
- package/build/tools/accountTools.js +5 -0
- package/build/tools/accountTools.js.map +1 -1
- package/build/tools/bundleTools.d.ts +3 -0
- package/build/tools/bundleTools.d.ts.map +1 -0
- package/build/tools/bundleTools.js +368 -0
- package/build/tools/bundleTools.js.map +1 -0
- package/build/tools/componentTools.d.ts +3 -0
- package/build/tools/componentTools.d.ts.map +1 -0
- package/build/tools/componentTools.js +704 -0
- package/build/tools/componentTools.js.map +1 -0
- package/build/tools/connectionTools.d.ts +3 -0
- package/build/tools/connectionTools.d.ts.map +1 -0
- package/build/tools/connectionTools.js +564 -0
- package/build/tools/connectionTools.js.map +1 -0
- package/build/tools/deviceTools.d.ts +3 -0
- package/build/tools/deviceTools.d.ts.map +1 -0
- package/build/tools/deviceTools.js +296 -0
- package/build/tools/deviceTools.js.map +1 -0
- package/build/tools/executionTools.d.ts +3 -0
- package/build/tools/executionTools.d.ts.map +1 -0
- package/build/tools/executionTools.js +245 -0
- package/build/tools/executionTools.js.map +1 -0
- package/build/tools/interactionTools.d.ts +3 -0
- package/build/tools/interactionTools.d.ts.map +1 -0
- package/build/tools/interactionTools.js +558 -0
- package/build/tools/interactionTools.js.map +1 -0
- package/build/tools/logTools.d.ts +3 -0
- package/build/tools/logTools.d.ts.map +1 -0
- package/build/tools/logTools.js +371 -0
- package/build/tools/logTools.js.map +1 -0
- package/build/tools/metaTools.d.ts +7 -0
- package/build/tools/metaTools.d.ts.map +1 -0
- package/build/tools/metaTools.js +205 -0
- package/build/tools/metaTools.js.map +1 -0
- package/build/tools/networkTools.d.ts +3 -0
- package/build/tools/networkTools.d.ts.map +1 -0
- package/build/tools/networkTools.js +478 -0
- package/build/tools/networkTools.js.map +1 -0
- package/build/tools/reduxTools.d.ts +3 -0
- package/build/tools/reduxTools.d.ts.map +1 -0
- package/build/tools/reduxTools.js +83 -0
- package/build/tools/reduxTools.js.map +1 -0
- package/build/tools/screenshotTools.d.ts +3 -0
- package/build/tools/screenshotTools.d.ts.map +1 -0
- package/build/tools/screenshotTools.js +606 -0
- package/build/tools/screenshotTools.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionTools.d.ts","sourceRoot":"","sources":["../../src/tools/interactionTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwBzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0qBhE"}
|
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { registerToolWithTelemetry } from "../core/register.js";
|
|
3
|
+
import { androidLongPress, androidSwipe, androidInputText, androidKeyEvent, ANDROID_KEY_EVENTS, iosButton, iosInputText, iosSwipe, IOS_BUTTON_TYPES, getActiveOrBootedSimulatorUdid, getDevicePixelRatio, getDefaultAndroidDevice, findSimulatorByName, connectedApps, } from "../core/index.js";
|
|
4
|
+
import { tap, convertScreenshotToTapCoords } from "../pro/tap.js";
|
|
5
|
+
import { clearFocusedInput, dismissKeyboard, inputTextWithReplace } from "../core/focusedInputTools.js";
|
|
6
|
+
import { primaryInteractionBanner, platformFallbackBanner, platformUniqueBanner } from "../core/toolHelpers.js";
|
|
7
|
+
export function registerInteractionTools(server) {
|
|
8
|
+
// Tool: Unified tap — tries fiber, accessibility, OCR, coordinate strategies
|
|
9
|
+
registerToolWithTelemetry(server, "tap", {
|
|
10
|
+
description: "Tap a UI element. Automatically tries multiple strategies: fiber tree (React), accessibility tree (native), and OCR (visual)." +
|
|
11
|
+
primaryInteractionBanner() + "\n" +
|
|
12
|
+
"PURPOSE: Single unified tap entry point — resolves text/testID/component/coordinates into a real touch event on the correct device.\n" +
|
|
13
|
+
"WHEN TO USE: Any time you need to press a button, focus an input, open a menu, or verify a handler fires. Prefer testID, then text, then component, then (x,y) from a screenshot's pressables list.\n" +
|
|
14
|
+
"WORKFLOW: ios_screenshot or android_screenshot -> tap(testID=\"...\") | tap(text=\"...\") | tap(x, y) -> screenshot again to verify. Use burst=true when meaningful=false but visual feedback looks transient.\n" +
|
|
15
|
+
"LIMITATIONS: iOS needs AXe (brew install cameroncooke/axe/axe) or IDB for accessibility/coordinate taps. Non-ASCII text skips fiber (Hermes); prefer testID. When iOS AND Android are connected, pass platform explicitly.\n" +
|
|
16
|
+
"GOOD: tap({ testID: \"login-btn\" }); tap({ text: \"Submit\" }); tap({ x: 300, y: 600 }); tap({ x: 300, y: 600, native: true, platform: \"android\" })\n" +
|
|
17
|
+
"BAD: tap({ text: \"\" }) or tap({ x: 0, y: 0 }) — missing a target. tap({ text: \"Submit\" }) without first screenshotting an ambiguous screen.\n" +
|
|
18
|
+
"SEE ALSO: call get_usage_guide(topic=\"interact\") for the full device-interaction playbook.",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
text: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Visible text to match (case-insensitive substring). ASCII only for fiber strategy; OCR handles non-ASCII."),
|
|
24
|
+
testID: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Exact match on the element's testID prop."),
|
|
28
|
+
component: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Component name match (case-insensitive substring, e.g. 'Button', 'MenuItem')."),
|
|
32
|
+
index: z.coerce
|
|
33
|
+
.number()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Zero-based index when multiple elements match (default: 0)."),
|
|
36
|
+
x: z.coerce
|
|
37
|
+
.number()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("X coordinate in pixels (from screenshot). Must provide both x and y."),
|
|
40
|
+
y: z.coerce
|
|
41
|
+
.number()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Y coordinate in pixels (from screenshot). Must provide both x and y."),
|
|
44
|
+
strategy: z
|
|
45
|
+
.enum(["auto", "fiber", "accessibility", "ocr", "coordinate"])
|
|
46
|
+
.optional()
|
|
47
|
+
.default("auto")
|
|
48
|
+
.describe('"auto" (default) tries fiber -> accessibility -> OCR. Set explicitly to skip strategies you know will fail.'),
|
|
49
|
+
maxTraversalDepth: z.coerce
|
|
50
|
+
.number()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe("Max parent levels to traverse when searching by component name (default: 15). " +
|
|
53
|
+
"Increase if your component is deeply wrapped (e.g. inside multiple HOCs/animation wrappers)."),
|
|
54
|
+
native: z
|
|
55
|
+
.boolean()
|
|
56
|
+
.optional()
|
|
57
|
+
.default(false)
|
|
58
|
+
.describe("When true, tap coordinates directly via ADB/simctl without requiring a React Native connection. " +
|
|
59
|
+
"Useful for interacting with native UI, system dialogs, or non-RN apps. Requires x/y coordinates."),
|
|
60
|
+
platform: z
|
|
61
|
+
.enum(["ios", "android"])
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("Target platform. Required when both iOS and Android devices are connected. Auto-detected if only one platform is available."),
|
|
64
|
+
device: z
|
|
65
|
+
.string()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Target device name (substring match against the connected RN app's device name). " +
|
|
68
|
+
"Use to pin the tap to a specific device when multiple are connected (e.g. \"iPhone SE\"). " +
|
|
69
|
+
"Run get_apps to see connected device names. For iOS, the matched device's simulatorUdid is used to scope the tap."),
|
|
70
|
+
udid: z
|
|
71
|
+
.string()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("iOS simulator UDID (from list_ios_simulators). Takes precedence over device/platform when set. " +
|
|
74
|
+
"iOS-only — pairing with platform=\"android\" returns an error."),
|
|
75
|
+
screenshot: z
|
|
76
|
+
.boolean()
|
|
77
|
+
.optional()
|
|
78
|
+
.default(true)
|
|
79
|
+
.describe("Return post-tap image bytes in the response. Default true. Set to false to drop the PNG bytes — verification still runs (set verify=false to skip that too). Combine with verify=true to get the meaningful/changeRate signal without paying the ~1MB-per-tap bandwidth cost."),
|
|
80
|
+
verify: z
|
|
81
|
+
.boolean()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe("Run before/after screenshot diff to detect if the tap had a meaningful visual effect. " +
|
|
84
|
+
"Default: true for coordinate/accessibility/ocr strategies, false for fiber. " +
|
|
85
|
+
"Independent of `screenshot` — verify can run with screenshot=false (the diff is computed internally; image bytes are dropped). " +
|
|
86
|
+
"When skipped, the response contains `verification: { skipped: true, skippedReason }` so callers can tell apart \"ran clean\" from \"never ran\"."),
|
|
87
|
+
burst: z
|
|
88
|
+
.boolean()
|
|
89
|
+
.optional()
|
|
90
|
+
.default(false)
|
|
91
|
+
.describe("Enable burst screenshot capture for enhanced verification. " +
|
|
92
|
+
"Captures 4 rapid screenshots (~150ms intervals) after the tap to detect transient visual feedback " +
|
|
93
|
+
"(press animations, highlights, ripples) that may settle before a standard after-screenshot. " +
|
|
94
|
+
"Results are stored in the image buffer (use get_images to inspect individual frames). " +
|
|
95
|
+
"Default: false."),
|
|
96
|
+
},
|
|
97
|
+
}, async (args) => {
|
|
98
|
+
const result = await tap({
|
|
99
|
+
text: args.text,
|
|
100
|
+
testID: args.testID,
|
|
101
|
+
component: args.component,
|
|
102
|
+
index: args.index,
|
|
103
|
+
x: args.x,
|
|
104
|
+
y: args.y,
|
|
105
|
+
strategy: args.strategy,
|
|
106
|
+
maxTraversalDepth: args.maxTraversalDepth,
|
|
107
|
+
native: args.native,
|
|
108
|
+
platform: args.platform,
|
|
109
|
+
device: args.device,
|
|
110
|
+
udid: args.udid,
|
|
111
|
+
screenshot: args.screenshot,
|
|
112
|
+
verify: args.verify,
|
|
113
|
+
burst: args.burst,
|
|
114
|
+
});
|
|
115
|
+
const { screenshot: screenshotData, ...resultWithoutScreenshot } = result;
|
|
116
|
+
const text = JSON.stringify(resultWithoutScreenshot, null, 2);
|
|
117
|
+
// Pack predicate + strategy mode + attempted strategies into errorContext for telemetry.
|
|
118
|
+
// Always include the predicate so unmeaningful outcomes (no isError, no _errorMessage) still
|
|
119
|
+
// carry triage context — otherwise blob8 ends up blank and the dashboard shows empty rows.
|
|
120
|
+
// e.g. "p={\"text\":\"Save\"}|s=ocr|fiber:no_pressable|ocr:no_match"
|
|
121
|
+
const stratPrefix = args.strategy && args.strategy !== "auto" ? `s=${args.strategy}|` : "";
|
|
122
|
+
let predicatePrefix = "";
|
|
123
|
+
try {
|
|
124
|
+
if (result.query !== undefined) {
|
|
125
|
+
predicatePrefix = `p=${JSON.stringify(result.query)}|`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// query may contain non-serializable values — drop the prefix rather than fail.
|
|
130
|
+
}
|
|
131
|
+
const attemptedPart = result.attempted?.length
|
|
132
|
+
? result.attempted.map(a => `${a.strategy}:${a.reason.slice(0, 40)}`).join("|")
|
|
133
|
+
: "";
|
|
134
|
+
const ctxParts = `${predicatePrefix}${stratPrefix}${attemptedPart}`;
|
|
135
|
+
const errorContext = ctxParts ? ctxParts.replace(/\|$/, "") : undefined;
|
|
136
|
+
const content = [
|
|
137
|
+
{ type: "text", text },
|
|
138
|
+
];
|
|
139
|
+
if (screenshotData) {
|
|
140
|
+
content.push({
|
|
141
|
+
type: "image",
|
|
142
|
+
data: screenshotData.image,
|
|
143
|
+
mimeType: "image/jpeg",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
content,
|
|
148
|
+
isError: !result.success && !result.ambiguous,
|
|
149
|
+
_errorMessage: !result.success && !result.ambiguous
|
|
150
|
+
? `${JSON.stringify(result.query)}|${result.error || ""}`
|
|
151
|
+
: undefined,
|
|
152
|
+
_errorContext: errorContext,
|
|
153
|
+
_meaningful: result.verification?.meaningful,
|
|
154
|
+
_changeRate: result.verification?.changeRate,
|
|
155
|
+
_tapStrategy: result.method,
|
|
156
|
+
_iosDriver: result.platform === "ios" ? (process.env.IOS_DRIVER?.toLowerCase() || "axe") : undefined,
|
|
157
|
+
_artifactKey: result.artifactKey,
|
|
158
|
+
_ocrClosestMatch: result.ocrClosestMatch,
|
|
159
|
+
_fiberPressableCount: result.fiberPressableCount,
|
|
160
|
+
_accessibilityMatchCount: result.accessibilityMatchCount,
|
|
161
|
+
_appRoute: result.appRoute,
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
// Android UI Input Tools (Phase 2)
|
|
165
|
+
// ============================================================================
|
|
166
|
+
// Tool: Android long press
|
|
167
|
+
registerToolWithTelemetry(server, "android_long_press", {
|
|
168
|
+
description: "Long press at specific coordinates on an Android device/emulator screen" +
|
|
169
|
+
platformFallbackBanner("`tap` for short taps; keep android_long_press for long-press gestures specifically") +
|
|
170
|
+
"\nPURPOSE: Emit a sustained touch at raw pixel coordinates to trigger long-press handlers (context menus, drag starts, multi-select)." +
|
|
171
|
+
"\nWHEN TO USE: Only when a long-press gesture is required — regular taps should go through `tap`." +
|
|
172
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
173
|
+
inputSchema: {
|
|
174
|
+
x: z.coerce.number().describe("X coordinate in pixels"),
|
|
175
|
+
y: z.coerce.number().describe("Y coordinate in pixels"),
|
|
176
|
+
durationMs: z.number().optional().default(1000).describe("Press duration in milliseconds (default: 1000)"),
|
|
177
|
+
deviceId: z
|
|
178
|
+
.string()
|
|
179
|
+
.optional()
|
|
180
|
+
.describe("Optional device ID. Uses first available device if not specified.")
|
|
181
|
+
}
|
|
182
|
+
}, async ({ x, y, durationMs, deviceId }) => {
|
|
183
|
+
const result = await androidLongPress(x, y, durationMs, deviceId);
|
|
184
|
+
return {
|
|
185
|
+
content: [
|
|
186
|
+
{
|
|
187
|
+
type: "text",
|
|
188
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
isError: !result.success
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
// Tool: Android swipe
|
|
195
|
+
registerToolWithTelemetry(server, "android_swipe", {
|
|
196
|
+
description: "Swipe from one point to another on an Android device/emulator screen" +
|
|
197
|
+
platformFallbackBanner("`tap` for targeted interactions; keep android_swipe for raw-coordinate gestures") +
|
|
198
|
+
"\nPURPOSE: Perform a raw-coordinate swipe gesture for scrolling, paging, dismissing sheets, or drawer opens on Android." +
|
|
199
|
+
"\nWHEN TO USE: When you need a gesture rather than a tap — scroll lists, swipe carousels, or pull-to-refresh." +
|
|
200
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
201
|
+
inputSchema: {
|
|
202
|
+
startX: z.coerce.number().describe("Starting X coordinate in pixels"),
|
|
203
|
+
startY: z.coerce.number().describe("Starting Y coordinate in pixels"),
|
|
204
|
+
endX: z.coerce.number().describe("Ending X coordinate in pixels"),
|
|
205
|
+
endY: z.coerce.number().describe("Ending Y coordinate in pixels"),
|
|
206
|
+
durationMs: z.number().optional().default(300).describe("Swipe duration in milliseconds (default: 300)"),
|
|
207
|
+
deviceId: z
|
|
208
|
+
.string()
|
|
209
|
+
.optional()
|
|
210
|
+
.describe("Optional device ID. Uses first available device if not specified.")
|
|
211
|
+
}
|
|
212
|
+
}, async ({ startX, startY, endX, endY, durationMs, deviceId }) => {
|
|
213
|
+
const result = await androidSwipe(startX, startY, endX, endY, durationMs, deviceId);
|
|
214
|
+
return {
|
|
215
|
+
content: [
|
|
216
|
+
{
|
|
217
|
+
type: "text",
|
|
218
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
isError: !result.success
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
// Tool: iOS swipe
|
|
225
|
+
registerToolWithTelemetry(server, "ios_swipe", {
|
|
226
|
+
description: "Swipe gesture on an iOS simulator screen." +
|
|
227
|
+
platformFallbackBanner("`swipe` for cross-platform gestures; `tap` for targeted interactions") +
|
|
228
|
+
" Pass screenshot pixel coordinates directly — the same values returned by ios_screenshot pressable elements and screen layout. Coordinates are auto-converted to native iOS points internally. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion)." +
|
|
229
|
+
"\nPURPOSE: Perform a raw-coordinate swipe gesture for scrolling, paging, dismissing sheets, or drawer opens on iOS." +
|
|
230
|
+
"\nWHEN TO USE: When you need a gesture rather than a tap — scroll lists, swipe carousels, or pull-to-refresh." +
|
|
231
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
232
|
+
inputSchema: {
|
|
233
|
+
startX: z.coerce.number().describe("Starting X coordinate in screenshot pixels (from ios_screenshot output)"),
|
|
234
|
+
startY: z.coerce.number().describe("Starting Y coordinate in screenshot pixels (from ios_screenshot output)"),
|
|
235
|
+
endX: z.coerce.number().describe("Ending X coordinate in screenshot pixels (from ios_screenshot output)"),
|
|
236
|
+
endY: z.coerce.number().describe("Ending Y coordinate in screenshot pixels (from ios_screenshot output)"),
|
|
237
|
+
duration: z.coerce.number().optional().describe("Optional swipe duration in seconds"),
|
|
238
|
+
delta: z.coerce.number().optional().describe("Optional delta between touch events (step size)"),
|
|
239
|
+
udid: z.string().optional().describe("Optional simulator UDID. Uses booted simulator if not specified.")
|
|
240
|
+
}
|
|
241
|
+
}, async ({ startX, startY, endX, endY, duration, delta, udid }) => {
|
|
242
|
+
const dpr = await getDevicePixelRatio(udid);
|
|
243
|
+
const firstApp = connectedApps.values().next().value;
|
|
244
|
+
const scaleFactor = firstApp?.lastScreenshot?.scaleFactor ?? 1;
|
|
245
|
+
const start = convertScreenshotToTapCoords(startX, startY, "ios", dpr, scaleFactor);
|
|
246
|
+
const end = convertScreenshotToTapCoords(endX, endY, "ios", dpr, scaleFactor);
|
|
247
|
+
const result = await iosSwipe(start.x, start.y, end.x, end.y, { duration, delta, udid });
|
|
248
|
+
return {
|
|
249
|
+
content: [
|
|
250
|
+
{
|
|
251
|
+
type: "text",
|
|
252
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
isError: !result.success
|
|
256
|
+
};
|
|
257
|
+
});
|
|
258
|
+
// Tool: Cross-platform swipe — auto-routes to iOS or Android backend
|
|
259
|
+
registerToolWithTelemetry(server, "swipe", {
|
|
260
|
+
description: "Swipe gesture that auto-routes to the correct platform (iOS or Android)." +
|
|
261
|
+
primaryInteractionBanner() + "\n" +
|
|
262
|
+
"PURPOSE: Single unified swipe entry point — accepts screenshot pixel coordinates and dispatches to ios_swipe or android_swipe based on the connected device.\n" +
|
|
263
|
+
"WHEN TO USE: Scrolling lists, paging carousels, pull-to-refresh, dismissing sheets, opening drawers — anything that needs a gesture rather than a tap. Especially useful in virtualized lists (FlatList/SectionList) where off-screen items aren't mounted in the fiber tree.\n" +
|
|
264
|
+
"WORKFLOW: ios_screenshot or android_screenshot -> swipe({ startX, startY, endX, endY }) -> screenshot again to verify.\n" +
|
|
265
|
+
"LIMITATIONS: iOS needs AXe (brew install cameroncooke/axe/axe) or IDB. When both iOS and Android devices are connected, pass platform explicitly.\n" +
|
|
266
|
+
"SEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
267
|
+
inputSchema: {
|
|
268
|
+
startX: z.coerce.number().describe("Starting X coordinate in screenshot pixels"),
|
|
269
|
+
startY: z.coerce.number().describe("Starting Y coordinate in screenshot pixels"),
|
|
270
|
+
endX: z.coerce.number().describe("Ending X coordinate in screenshot pixels"),
|
|
271
|
+
endY: z.coerce.number().describe("Ending Y coordinate in screenshot pixels"),
|
|
272
|
+
durationMs: z.coerce
|
|
273
|
+
.number()
|
|
274
|
+
.optional()
|
|
275
|
+
.describe("Swipe duration in milliseconds (default: 300 on Android; iOS uses driver default if omitted)"),
|
|
276
|
+
platform: z
|
|
277
|
+
.enum(["ios", "android"])
|
|
278
|
+
.optional()
|
|
279
|
+
.describe("Target platform. Required when both iOS and Android devices are connected. Auto-detected if only one is available."),
|
|
280
|
+
device: z
|
|
281
|
+
.string()
|
|
282
|
+
.optional()
|
|
283
|
+
.describe("Optional iOS simulator name (substring match) to disambiguate when multiple simulators are booted."),
|
|
284
|
+
udid: z.string().optional().describe("Optional iOS simulator UDID. Forces iOS targeting."),
|
|
285
|
+
deviceId: z.string().optional().describe("Optional Android device ID. Uses first available Android device if not specified.")
|
|
286
|
+
}
|
|
287
|
+
}, async ({ startX, startY, endX, endY, durationMs, platform, device, udid, deviceId }) => {
|
|
288
|
+
// Platform resolution mirrors the tap() native-mode flow (src/pro/tap.ts).
|
|
289
|
+
if (udid && platform === "android") {
|
|
290
|
+
return {
|
|
291
|
+
content: [{ type: "text", text: 'Error: udid is only valid for iOS. Got platform: "android".' }],
|
|
292
|
+
isError: true
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
let resolvedPlatform = platform;
|
|
296
|
+
let resolvedUdid;
|
|
297
|
+
if (udid) {
|
|
298
|
+
resolvedPlatform = "ios";
|
|
299
|
+
resolvedUdid = udid;
|
|
300
|
+
}
|
|
301
|
+
else if (!resolvedPlatform) {
|
|
302
|
+
const deviceMatchedUdid = device
|
|
303
|
+
? await findSimulatorByName(device).catch(() => null)
|
|
304
|
+
: null;
|
|
305
|
+
if (deviceMatchedUdid) {
|
|
306
|
+
resolvedPlatform = "ios";
|
|
307
|
+
resolvedUdid = deviceMatchedUdid;
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
const [androidDevice, iosSimulator] = await Promise.all([
|
|
311
|
+
getDefaultAndroidDevice().catch(() => null),
|
|
312
|
+
getActiveOrBootedSimulatorUdid().catch(() => null)
|
|
313
|
+
]);
|
|
314
|
+
if (androidDevice && iosSimulator) {
|
|
315
|
+
return {
|
|
316
|
+
content: [{ type: "text", text: 'Error: Multiple platforms detected (both Android and iOS). Specify platform: "android" or platform: "ios" to target the correct device.' }],
|
|
317
|
+
isError: true
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
if (androidDevice) {
|
|
321
|
+
resolvedPlatform = "android";
|
|
322
|
+
}
|
|
323
|
+
else if (iosSimulator) {
|
|
324
|
+
resolvedPlatform = "ios";
|
|
325
|
+
resolvedUdid = iosSimulator;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
return {
|
|
329
|
+
content: [{ type: "text", text: "Error: No Android device or iOS simulator found. Connect a device or start a simulator." }],
|
|
330
|
+
isError: true
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
else if (resolvedPlatform === "ios") {
|
|
336
|
+
resolvedUdid =
|
|
337
|
+
(device ? await findSimulatorByName(device).catch(() => null) : null) ??
|
|
338
|
+
(await getActiveOrBootedSimulatorUdid().catch(() => null)) ??
|
|
339
|
+
undefined;
|
|
340
|
+
}
|
|
341
|
+
let result;
|
|
342
|
+
if (resolvedPlatform === "ios") {
|
|
343
|
+
const dpr = await getDevicePixelRatio(resolvedUdid);
|
|
344
|
+
const firstApp = connectedApps.values().next().value;
|
|
345
|
+
const scaleFactor = firstApp?.lastScreenshot?.scaleFactor ?? 1;
|
|
346
|
+
const start = convertScreenshotToTapCoords(startX, startY, "ios", dpr, scaleFactor);
|
|
347
|
+
const end = convertScreenshotToTapCoords(endX, endY, "ios", dpr, scaleFactor);
|
|
348
|
+
const duration = durationMs !== undefined ? durationMs / 1000 : undefined;
|
|
349
|
+
result = await iosSwipe(start.x, start.y, end.x, end.y, { duration, udid: resolvedUdid });
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
const firstApp = connectedApps.values().next().value;
|
|
353
|
+
const scaleFactor = firstApp?.lastScreenshot?.scaleFactor ?? 1;
|
|
354
|
+
const start = convertScreenshotToTapCoords(startX, startY, "android", 1, scaleFactor);
|
|
355
|
+
const end = convertScreenshotToTapCoords(endX, endY, "android", 1, scaleFactor);
|
|
356
|
+
result = await androidSwipe(start.x, start.y, end.x, end.y, durationMs ?? 300, deviceId);
|
|
357
|
+
}
|
|
358
|
+
return {
|
|
359
|
+
content: [
|
|
360
|
+
{
|
|
361
|
+
type: "text",
|
|
362
|
+
text: result.success ? `[${resolvedPlatform}] ${result.result}` : `Error: ${result.error}`
|
|
363
|
+
}
|
|
364
|
+
],
|
|
365
|
+
isError: !result.success
|
|
366
|
+
};
|
|
367
|
+
});
|
|
368
|
+
// Tool: Android input text
|
|
369
|
+
registerToolWithTelemetry(server, "android_input_text", {
|
|
370
|
+
description: "Type text on an Android device/emulator." +
|
|
371
|
+
platformFallbackBanner("`tap(text=...)` — it auto-focuses TextInput via the fiber tree") +
|
|
372
|
+
" The text will be input at the current focus point (tap an input field first)." +
|
|
373
|
+
"\nPURPOSE: Send keystrokes to whichever input currently has focus on Android — the tool does NOT focus a field itself." +
|
|
374
|
+
"\nWHEN TO USE: Only after an input is already focused, or when `tap(text=...)` on the input didn't take focus for some reason." +
|
|
375
|
+
"\nREPLACE MODE: pass replace:true to clear the focused field first (via React onChangeText so controlled state stays consistent), then type the new value. Use for pre-filled fields where appending would corrupt the value." +
|
|
376
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
377
|
+
inputSchema: {
|
|
378
|
+
text: z.string().describe("Text to type"),
|
|
379
|
+
replace: z
|
|
380
|
+
.boolean()
|
|
381
|
+
.optional()
|
|
382
|
+
.describe("If true, clear the focused TextInput via React onChangeText before typing. Use to set a pre-filled field to an exact value without concatenation. Requires Bridgeless/Fabric."),
|
|
383
|
+
device: z
|
|
384
|
+
.string()
|
|
385
|
+
.optional()
|
|
386
|
+
.describe("Optional RN device name (substring match) — needed by replace:true when multiple RN apps are connected, to disambiguate which device's focused input to clear. Single-device sessions can omit."),
|
|
387
|
+
deviceId: z
|
|
388
|
+
.string()
|
|
389
|
+
.optional()
|
|
390
|
+
.describe("Optional device ID. Uses first available device if not specified.")
|
|
391
|
+
}
|
|
392
|
+
}, async ({ text, replace, device, deviceId }) => {
|
|
393
|
+
const result = await inputTextWithReplace(text, replace === true, (t) => androidInputText(t, deviceId), () => clearFocusedInput(device));
|
|
394
|
+
return {
|
|
395
|
+
content: [
|
|
396
|
+
{
|
|
397
|
+
type: "text",
|
|
398
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
399
|
+
}
|
|
400
|
+
],
|
|
401
|
+
isError: !result.success
|
|
402
|
+
};
|
|
403
|
+
});
|
|
404
|
+
// Tool: Android key event
|
|
405
|
+
registerToolWithTelemetry(server, "android_key_event", {
|
|
406
|
+
description: "Send a key event to an Android device/emulator." +
|
|
407
|
+
platformUniqueBanner("sending Android key events (BACK, HOME, MENU, etc.)") +
|
|
408
|
+
` Common keys: ${Object.keys(ANDROID_KEY_EVENTS).join(", ")}` +
|
|
409
|
+
"\nPURPOSE: Dispatch Android system keys (BACK, HOME, MENU, ENTER, DEL, etc.) that aren't reachable via on-screen tap." +
|
|
410
|
+
"\nWHEN TO USE: Navigate back from a screen, submit a form with ENTER, dismiss the keyboard, or press hardware-style keys during a flow." +
|
|
411
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
412
|
+
inputSchema: {
|
|
413
|
+
key: z.string().describe(`Key name (${Object.keys(ANDROID_KEY_EVENTS).join(", ")}) or numeric keycode`),
|
|
414
|
+
deviceId: z
|
|
415
|
+
.string()
|
|
416
|
+
.optional()
|
|
417
|
+
.describe("Optional device ID. Uses first available device if not specified.")
|
|
418
|
+
}
|
|
419
|
+
}, async ({ key, deviceId }) => {
|
|
420
|
+
// Try to parse as number first, otherwise treat as key name
|
|
421
|
+
const keyCode = /^\d+$/.test(key) ? parseInt(key, 10) : key.toUpperCase();
|
|
422
|
+
const result = await androidKeyEvent(keyCode, deviceId);
|
|
423
|
+
return {
|
|
424
|
+
content: [
|
|
425
|
+
{
|
|
426
|
+
type: "text",
|
|
427
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
428
|
+
}
|
|
429
|
+
],
|
|
430
|
+
isError: !result.success
|
|
431
|
+
};
|
|
432
|
+
});
|
|
433
|
+
// ============================================================================
|
|
434
|
+
// Android Accessibility Tools (UI Hierarchy)
|
|
435
|
+
// ============================================================================
|
|
436
|
+
// ============================================================================
|
|
437
|
+
// iOS Simulator Tools
|
|
438
|
+
// ============================================================================
|
|
439
|
+
// Tool: iOS install app
|
|
440
|
+
// ============================================================================
|
|
441
|
+
// iOS UI Interaction Tools (require an iOS UI driver)
|
|
442
|
+
// Default: AXe — brew install cameroncooke/axe/axe
|
|
443
|
+
// Alternative: IDB — brew install idb-companion (set IOS_DRIVER=idb)
|
|
444
|
+
// ============================================================================
|
|
445
|
+
// Tool: iOS button
|
|
446
|
+
server.registerTool("ios_button", {
|
|
447
|
+
description: "Press a hardware button on an iOS simulator." +
|
|
448
|
+
platformUniqueBanner("pressing iOS hardware buttons (HOME, LOCK, SIRI, APPLE_PAY)") +
|
|
449
|
+
" Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion)." +
|
|
450
|
+
"\nPURPOSE: Trigger iOS hardware buttons (HOME, LOCK, SIDE_BUTTON, SIRI, APPLE_PAY) that aren't reachable via on-screen tap." +
|
|
451
|
+
"\nWHEN TO USE: Send the app to background (HOME), lock the simulator (LOCK), or exercise Siri/Apple Pay flows." +
|
|
452
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
453
|
+
inputSchema: {
|
|
454
|
+
button: z
|
|
455
|
+
.enum(IOS_BUTTON_TYPES)
|
|
456
|
+
.describe("Hardware button to press: HOME, LOCK, SIDE_BUTTON, SIRI, or APPLE_PAY"),
|
|
457
|
+
duration: z.coerce.number().optional().describe("Optional button press duration in seconds"),
|
|
458
|
+
udid: z.string().optional().describe("Optional simulator UDID. Uses booted simulator if not specified.")
|
|
459
|
+
}
|
|
460
|
+
}, async ({ button, duration, udid }) => {
|
|
461
|
+
const result = await iosButton(button, { duration, udid });
|
|
462
|
+
return {
|
|
463
|
+
content: [
|
|
464
|
+
{
|
|
465
|
+
type: "text",
|
|
466
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
isError: !result.success
|
|
470
|
+
};
|
|
471
|
+
});
|
|
472
|
+
// Tool: Clear focused text input
|
|
473
|
+
registerToolWithTelemetry(server, "clear_focused_input", {
|
|
474
|
+
description: "Clear the contents of the currently focused TextInput, updating React state correctly so controlled components (Formik, react-hook-form, useState) stay consistent." +
|
|
475
|
+
"\nPURPOSE: Reset whatever TextInput has focus to empty, with the React state owner notified via onChangeText. Use BEFORE typing a replacement value into a pre-filled field." +
|
|
476
|
+
"\nWHEN TO USE: After tap(testID=...) focuses an input that already has text. Pair with ios_input_text/android_input_text (or use their replace:true flag for one-shot)." +
|
|
477
|
+
"\nLIMITATIONS: Requires Bridgeless/Fabric (RN new architecture). Returns 'no focused TextInput' if nothing is focused — does not silently no-op." +
|
|
478
|
+
"\nSEE ALSO: dismiss_keyboard, ios_input_text({replace:true}), android_input_text({replace:true}). call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
479
|
+
inputSchema: {
|
|
480
|
+
device: z
|
|
481
|
+
.string()
|
|
482
|
+
.optional()
|
|
483
|
+
.describe("Optional device name (substring match). Uses default device if not specified.")
|
|
484
|
+
}
|
|
485
|
+
}, async ({ device }) => {
|
|
486
|
+
const result = await clearFocusedInput(device);
|
|
487
|
+
return {
|
|
488
|
+
content: [
|
|
489
|
+
{
|
|
490
|
+
type: "text",
|
|
491
|
+
text: result.success ? `Cleared focused input (via ${result.via}).` : `Error: ${result.error}`
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
isError: !result.success
|
|
495
|
+
};
|
|
496
|
+
});
|
|
497
|
+
// Tool: Dismiss keyboard
|
|
498
|
+
registerToolWithTelemetry(server, "dismiss_keyboard", {
|
|
499
|
+
description: "Blur the currently focused TextInput, dismissing the on-screen keyboard." +
|
|
500
|
+
"\nPURPOSE: Close the keyboard when it's blocking content beneath the input, or move focus off an input before a tap that would otherwise be intercepted." +
|
|
501
|
+
"\nWHEN TO USE: After typing into a field and before tapping a button that is hidden by the keyboard. Or to verify a 'tap outside dismisses' UX is wired up." +
|
|
502
|
+
"\nLIMITATIONS: Requires Bridgeless/Fabric (RN new architecture). Returns 'no focused TextInput' if nothing is focused.",
|
|
503
|
+
inputSchema: {
|
|
504
|
+
device: z
|
|
505
|
+
.string()
|
|
506
|
+
.optional()
|
|
507
|
+
.describe("Optional device name (substring match). Uses default device if not specified.")
|
|
508
|
+
}
|
|
509
|
+
}, async ({ device }) => {
|
|
510
|
+
const result = await dismissKeyboard(device);
|
|
511
|
+
return {
|
|
512
|
+
content: [
|
|
513
|
+
{
|
|
514
|
+
type: "text",
|
|
515
|
+
text: result.success
|
|
516
|
+
? `Dismissed keyboard (nativeTag ${result.nativeTag}).`
|
|
517
|
+
: `Error: ${result.error}`
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
isError: !result.success
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
// Tool: iOS input text
|
|
524
|
+
registerToolWithTelemetry(server, "ios_input_text", {
|
|
525
|
+
description: "Type text on an iOS simulator." +
|
|
526
|
+
platformFallbackBanner("`tap(text=...)` — it auto-focuses TextInput via the fiber tree") +
|
|
527
|
+
" The text is typed into whichever field currently has focus (tap an input first). Mirrors `android_input_text` so cross-platform agents can use `<platform>_input_text` without branching on the iOS driver shell-out." +
|
|
528
|
+
"\nPURPOSE: Send keystrokes to the focused field on an iOS simulator via the active UI driver (AXe — preferred — or IDB)." +
|
|
529
|
+
"\nWHEN TO USE: Only after an input is already focused, or when `tap(testID=...)` on the input didn't take focus for some reason. Use the testID-first flow whenever possible — it's faster and survives UI repositioning." +
|
|
530
|
+
"\nREPLACE MODE: pass replace:true to clear the focused field first (via React onChangeText so controlled state stays consistent), then type the new value. Use for pre-filled fields where appending would corrupt the value." +
|
|
531
|
+
"\nLIMITATIONS: AXe types via the US-keyboard HID — non-ASCII characters (Cyrillic, CJK, Arabic) may not transmit correctly. If the active driver is AXe and the text contains non-ASCII chars, prefer pasting via the simulator pasteboard or setting IOS_DRIVER=idb." +
|
|
532
|
+
"\nSEE ALSO: call get_usage_guide(topic=\"interact\") for the full UI-interaction playbook.",
|
|
533
|
+
inputSchema: {
|
|
534
|
+
text: z.string().describe("Text to type into the currently focused field."),
|
|
535
|
+
replace: z
|
|
536
|
+
.boolean()
|
|
537
|
+
.optional()
|
|
538
|
+
.describe("If true, clear the focused TextInput via React onChangeText before typing. Use to set a pre-filled field to an exact value without concatenation. Requires Bridgeless/Fabric."),
|
|
539
|
+
device: z
|
|
540
|
+
.string()
|
|
541
|
+
.optional()
|
|
542
|
+
.describe("Optional RN device name (substring match) — needed by replace:true when multiple RN apps are connected, to disambiguate which device's focused input to clear. Single-device sessions can omit."),
|
|
543
|
+
udid: z.string().optional().describe("Optional simulator UDID (from list_ios_simulators). Uses booted simulator if not specified.")
|
|
544
|
+
}
|
|
545
|
+
}, async ({ text, replace, device, udid }) => {
|
|
546
|
+
const result = await inputTextWithReplace(text, replace === true, (t) => iosInputText(t, udid), () => clearFocusedInput(device));
|
|
547
|
+
return {
|
|
548
|
+
content: [
|
|
549
|
+
{
|
|
550
|
+
type: "text",
|
|
551
|
+
text: result.success ? result.result : `Error: ${result.error}`
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
isError: !result.success
|
|
555
|
+
};
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
//# sourceMappingURL=interactionTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionTools.js","sourceRoot":"","sources":["../../src/tools/interactionTools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACH,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAEhB,8BAA8B,EAC9B,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,4BAA4B,EAAkB,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEhH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACtD,6EAA6E;IAC7E,yBAAyB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