react-native-ai-devtools 1.4.21 → 1.4.23
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/build/core/feedback.d.ts +18 -0
- package/build/core/feedback.d.ts.map +1 -0
- package/build/core/feedback.js +73 -0
- package/build/core/feedback.js.map +1 -0
- package/build/core/guides.d.ts.map +1 -1
- package/build/core/guides.js +39 -0
- package/build/core/guides.js.map +1 -1
- package/build/core/index.d.ts +1 -0
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +2 -0
- package/build/core/index.js.map +1 -1
- package/build/core/ios.d.ts.map +1 -1
- package/build/core/ios.js +7 -5
- package/build/core/ios.js.map +1 -1
- package/build/core/license.d.ts.map +1 -1
- package/build/core/license.js +16 -38
- package/build/core/license.js.map +1 -1
- package/build/index.js +112 -14
- package/build/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/core/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/core/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;A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;IAC/B,IAAI,CAAC,YAAY;QAAE,OAAO;IAC1B,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC;IACvB,oEAAoE;IACpE,IAAI,YAAY,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;QAC/B,eAAe,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe;IAC3B,OAAO,aAAa,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,YAAY;IACxB,aAAa,GAAG,IAAI,CAAC;IACrB,cAAc,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC;QACD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC3B,UAAU,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,sBAAsB;IAC1B,CAAC;AACL,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -38,8 +38,8 @@ androidDescribeAll, androidDescribePoint,
|
|
|
38
38
|
androidFindElement, androidWaitForElement,
|
|
39
39
|
// iOS
|
|
40
40
|
listIOSSimulators, iosScreenshot, iosInstallApp, iosLaunchApp, iosOpenUrl, iosTerminateApp, iosBootSimulator,
|
|
41
|
-
// iOS
|
|
42
|
-
iosTap, iosSwipe, iosInputText, iosButton, iosKeyEvent, iosKeySequence, iosDescribeAll, iosDescribePoint, IOS_BUTTON_TYPES,
|
|
41
|
+
// iOS UI driver tools
|
|
42
|
+
isUiDriverAvailable, iosTap, iosSwipe, iosInputText, iosButton, iosKeyEvent, iosKeySequence, iosDescribeAll, iosDescribePoint, IOS_BUTTON_TYPES,
|
|
43
43
|
// iOS Element Finding (no screenshots)
|
|
44
44
|
iosFindElement, iosWaitForElement,
|
|
45
45
|
// Telemetry
|
|
@@ -47,7 +47,7 @@ initTelemetry, trackToolInvocation, getTargetPlatform,
|
|
|
47
47
|
// Format utilities (TONL)
|
|
48
48
|
formatLogsAsTonl, formatNetworkAsTonl,
|
|
49
49
|
// LogBox detection & control
|
|
50
|
-
detectLogBox, formatLogBoxWarning, dismissLogBox, formatDismissedEntries, pushLogBox, addLogBoxIgnorePatterns, verifyLogPipeline } from "./core/index.js";
|
|
50
|
+
detectLogBox, formatLogBoxWarning, dismissLogBox, formatDismissedEntries, pushLogBox, addLogBoxIgnorePatterns, verifyLogPipeline, formatIssueBody, buildGitHubUrl, shouldShowFeedbackHint, markFeedbackHintShown, } from "./core/index.js";
|
|
51
51
|
// Helper: resolve log buffer for a device (or create a merged buffer from all devices)
|
|
52
52
|
function resolveLogBuffer(device) {
|
|
53
53
|
if (device) {
|
|
@@ -155,6 +155,27 @@ function estimateImageTokens(base64Data) {
|
|
|
155
155
|
return Math.ceil(base64Data.length / 4); // fallback
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
// Tools that do NOT require an active Metro connection — excluded from feedback hint trigger
|
|
159
|
+
const NON_METRO_TOOLS = new Set([
|
|
160
|
+
"scan_metro",
|
|
161
|
+
"connect_metro",
|
|
162
|
+
"disconnect_metro",
|
|
163
|
+
"ensure_connection",
|
|
164
|
+
"get_connection_status",
|
|
165
|
+
"get_license_status",
|
|
166
|
+
"activate_license",
|
|
167
|
+
"delete_account",
|
|
168
|
+
"get_usage_guide",
|
|
169
|
+
"get_apps",
|
|
170
|
+
"list_ios_simulators",
|
|
171
|
+
"list_android_devices",
|
|
172
|
+
"ios_boot_simulator",
|
|
173
|
+
"ios_launch_app",
|
|
174
|
+
"android_launch_app",
|
|
175
|
+
"ios_install_app",
|
|
176
|
+
"android_install_app",
|
|
177
|
+
"send_feedback"
|
|
178
|
+
]);
|
|
158
179
|
// Registry for dev meta-tool — stores handlers and configs for dynamic dispatch
|
|
159
180
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
160
181
|
const toolRegistry = new Map();
|
|
@@ -242,6 +263,14 @@ function registerToolWithTelemetry(toolName, config, handler, emptyResultDetecto
|
|
|
242
263
|
responsePreview = textParts.join("\n").substring(0, 2000);
|
|
243
264
|
}
|
|
244
265
|
}
|
|
266
|
+
// First-install feedback hint — fires once on first successful Metro-connected tool
|
|
267
|
+
if (!NON_METRO_TOOLS.has(toolName) && shouldShowFeedbackHint()) {
|
|
268
|
+
markFeedbackHintShown();
|
|
269
|
+
// Fire-and-forget — don't block the tool response
|
|
270
|
+
pushLogBox("Congratulations on your first tool call! If you encounter any issues or have ideas for improvement, ask your AI assistant to call send_feedback. Your feedback helps me make this product better for everyone. Best regards, rn-ai-devtools developer.", "warning", true, "logbox").catch(() => {
|
|
271
|
+
// Non-fatal — hint delivery failure should not affect tool execution
|
|
272
|
+
});
|
|
273
|
+
}
|
|
245
274
|
return result;
|
|
246
275
|
}
|
|
247
276
|
catch (error) {
|
|
@@ -262,6 +291,12 @@ function registerToolWithTelemetry(toolName, config, handler, emptyResultDetecto
|
|
|
262
291
|
server_version: getServerVersion(),
|
|
263
292
|
...(errorMessage && { error: errorMessage.substring(0, 200) }),
|
|
264
293
|
...(getTargetPlatform() && { platform: getTargetPlatform() }),
|
|
294
|
+
...(tapStrategy && { tap_strategy: tapStrategy }),
|
|
295
|
+
...(meaningful !== undefined && { meaningful }),
|
|
296
|
+
...(changeRate !== undefined && { change_rate: changeRate }),
|
|
297
|
+
...(iosDriver && { ios_driver: iosDriver }),
|
|
298
|
+
...(emptyResult !== undefined && { empty_result: emptyResult }),
|
|
299
|
+
...(emptyReason && { empty_reason: emptyReason }),
|
|
265
300
|
},
|
|
266
301
|
});
|
|
267
302
|
}
|
|
@@ -406,6 +441,21 @@ registerToolWithTelemetry("scan_metro", {
|
|
|
406
441
|
// Build events connection is optional
|
|
407
442
|
}
|
|
408
443
|
}
|
|
444
|
+
// Proactive check: warn if iOS UI driver is missing
|
|
445
|
+
const hasIosDevice = Array.from(allDeviceNames.values()).some(({ device }) => {
|
|
446
|
+
const title = (device.title || "").toLowerCase();
|
|
447
|
+
return title.includes("iphone") || title.includes("ipad") || title.includes("ios");
|
|
448
|
+
});
|
|
449
|
+
if (hasIosDevice) {
|
|
450
|
+
const uiDriverOk = await isUiDriverAvailable();
|
|
451
|
+
if (!uiDriverOk) {
|
|
452
|
+
results.push("");
|
|
453
|
+
results.push("⚠️ WARNING: iOS UI driver is NOT installed. Tools like tap, ios_swipe, ios_input_text, ios_describe_all, and ios_find_element will fail.");
|
|
454
|
+
results.push(" Install the recommended driver: brew install cameroncooke/axe/axe");
|
|
455
|
+
results.push(" Then set IOS_DRIVER=axe in your MCP server environment.");
|
|
456
|
+
results.push(" Alternative: brew install idb-companion (used by default)");
|
|
457
|
+
}
|
|
458
|
+
}
|
|
409
459
|
return {
|
|
410
460
|
content: [
|
|
411
461
|
{
|
|
@@ -577,6 +627,52 @@ registerToolWithTelemetry("get_license_status", {
|
|
|
577
627
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
578
628
|
};
|
|
579
629
|
});
|
|
630
|
+
// Tool: Send feedback / bug report / feature request
|
|
631
|
+
registerToolWithTelemetry("send_feedback", {
|
|
632
|
+
description: "Create a feedback report (bug, feature request, or general feedback) for the react-native-ai-devtools team. " +
|
|
633
|
+
"Auto-collects environment info. Returns a pre-filled GitHub issue URL and formatted issue body. " +
|
|
634
|
+
"Ask the user to open the URL and paste the body to submit.",
|
|
635
|
+
inputSchema: {
|
|
636
|
+
type: z.enum(["feedback", "feature_request", "bug"]).describe('Type of feedback: "feedback", "feature_request", or "bug"'),
|
|
637
|
+
title: z.string().describe("Short summary (becomes the GitHub issue title)"),
|
|
638
|
+
description: z.string().describe("Detailed description of the feedback, feature request, or bug"),
|
|
639
|
+
workflow_context: z.string().optional().describe("What the user was trying to accomplish when they decided to give feedback")
|
|
640
|
+
}
|
|
641
|
+
}, async ({ type, title, description, workflow_context }) => {
|
|
642
|
+
// Collect environment info
|
|
643
|
+
const serverVersion = getServerVersion();
|
|
644
|
+
const platform = process.platform;
|
|
645
|
+
const deviceType = getTargetPlatform();
|
|
646
|
+
const licenseStatus = getLicenseStatus();
|
|
647
|
+
const env = {
|
|
648
|
+
serverVersion,
|
|
649
|
+
platform,
|
|
650
|
+
deviceType,
|
|
651
|
+
licenseTier: licenseStatus.tier
|
|
652
|
+
};
|
|
653
|
+
const input = { type, title, description, workflowContext: workflow_context };
|
|
654
|
+
const issueBody = formatIssueBody(input, env);
|
|
655
|
+
const githubUrl = buildGitHubUrl(title, type);
|
|
656
|
+
const output = [
|
|
657
|
+
"## Feedback Report Ready",
|
|
658
|
+
"",
|
|
659
|
+
`**GitHub Issue URL:** ${githubUrl}`,
|
|
660
|
+
"",
|
|
661
|
+
"**Issue body to paste:**",
|
|
662
|
+
"",
|
|
663
|
+
"```markdown",
|
|
664
|
+
issueBody,
|
|
665
|
+
"```",
|
|
666
|
+
"",
|
|
667
|
+
"Please ask the user to:",
|
|
668
|
+
"1. Open the GitHub URL above",
|
|
669
|
+
"2. Paste the issue body into the description field",
|
|
670
|
+
"3. Review and submit the issue"
|
|
671
|
+
].join("\n");
|
|
672
|
+
return {
|
|
673
|
+
content: [{ type: "text", text: output }]
|
|
674
|
+
};
|
|
675
|
+
});
|
|
580
676
|
// Tool: Ensure connection health
|
|
581
677
|
registerToolWithTelemetry("ensure_connection", {
|
|
582
678
|
description: "Verify or establish a healthy connection to a React Native app. Use before running commands if connection may be stale, or after navigation/reload. This tool runs a health check and will auto-reconnect if needed.",
|
|
@@ -1465,6 +1561,7 @@ registerToolWithTelemetry("find_components", {
|
|
|
1465
1561
|
registerToolWithTelemetry("tap", {
|
|
1466
1562
|
description: "Tap a UI element. Automatically tries multiple strategies: fiber tree (React), accessibility tree (native), and OCR (visual). " +
|
|
1467
1563
|
"Auto-detects platform (iOS/Android). For coordinates, pass raw pixel values from screenshot — tap handles all coordinate conversion internally (iOS pixel-to-point, scale factor adjustments).\n\n" +
|
|
1564
|
+
"PREREQUISITE: For iOS, an iOS UI driver must be installed — AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion). Without it, accessibility and coordinate strategies will fail.\n\n" +
|
|
1468
1565
|
"IMPORTANT: When both iOS and Android devices are connected, specify platform explicitly to avoid tapping on the wrong device.\n\n" +
|
|
1469
1566
|
"Examples:\n" +
|
|
1470
1567
|
"- tap(text=\"Submit\") — finds and taps element with matching text\n" +
|
|
@@ -3584,12 +3681,13 @@ registerToolWithTelemetry("ios_boot_simulator", {
|
|
|
3584
3681
|
};
|
|
3585
3682
|
});
|
|
3586
3683
|
// ============================================================================
|
|
3587
|
-
// iOS
|
|
3588
|
-
//
|
|
3684
|
+
// iOS UI Interaction Tools (require an iOS UI driver)
|
|
3685
|
+
// Recommended: AXe — brew install cameroncooke/axe/axe (set IOS_DRIVER=axe)
|
|
3686
|
+
// Alternative: IDB — brew install idb-companion (default)
|
|
3589
3687
|
// ============================================================================
|
|
3590
3688
|
// Tool: iOS swipe
|
|
3591
3689
|
server.registerTool("ios_swipe", {
|
|
3592
|
-
description: "Swipe gesture on an iOS simulator screen. Requires
|
|
3690
|
+
description: "Swipe gesture on an iOS simulator screen. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3593
3691
|
inputSchema: {
|
|
3594
3692
|
startX: z.coerce.number().describe("Starting X coordinate in pixels"),
|
|
3595
3693
|
startY: z.coerce.number().describe("Starting Y coordinate in pixels"),
|
|
@@ -3613,7 +3711,7 @@ server.registerTool("ios_swipe", {
|
|
|
3613
3711
|
});
|
|
3614
3712
|
// Tool: iOS input text
|
|
3615
3713
|
server.registerTool("ios_input_text", {
|
|
3616
|
-
description: "Type text into the active input field on an iOS simulator. Requires
|
|
3714
|
+
description: "Type text into the active input field on an iOS simulator. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3617
3715
|
inputSchema: {
|
|
3618
3716
|
text: z.string().describe("Text to type into the active input field"),
|
|
3619
3717
|
udid: z.string().optional().describe("Optional simulator UDID. Uses booted simulator if not specified.")
|
|
@@ -3632,7 +3730,7 @@ server.registerTool("ios_input_text", {
|
|
|
3632
3730
|
});
|
|
3633
3731
|
// Tool: iOS button
|
|
3634
3732
|
server.registerTool("ios_button", {
|
|
3635
|
-
description: "Press a hardware button on an iOS simulator. Requires
|
|
3733
|
+
description: "Press a hardware button on an iOS simulator. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3636
3734
|
inputSchema: {
|
|
3637
3735
|
button: z
|
|
3638
3736
|
.enum(IOS_BUTTON_TYPES)
|
|
@@ -3654,7 +3752,7 @@ server.registerTool("ios_button", {
|
|
|
3654
3752
|
});
|
|
3655
3753
|
// Tool: iOS key event
|
|
3656
3754
|
server.registerTool("ios_key_event", {
|
|
3657
|
-
description: "Send a key event to an iOS simulator by keycode. Requires
|
|
3755
|
+
description: "Send a key event to an iOS simulator by keycode. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3658
3756
|
inputSchema: {
|
|
3659
3757
|
keycode: z.coerce.number().describe("iOS keycode to send"),
|
|
3660
3758
|
duration: z.coerce.number().optional().describe("Optional key press duration in seconds"),
|
|
@@ -3674,7 +3772,7 @@ server.registerTool("ios_key_event", {
|
|
|
3674
3772
|
});
|
|
3675
3773
|
// Tool: iOS key sequence
|
|
3676
3774
|
server.registerTool("ios_key_sequence", {
|
|
3677
|
-
description: "Send a sequence of key events to an iOS simulator. Requires
|
|
3775
|
+
description: "Send a sequence of key events to an iOS simulator. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3678
3776
|
inputSchema: {
|
|
3679
3777
|
keycodes: z.array(z.coerce.number()).describe("Array of iOS keycodes to send in sequence"),
|
|
3680
3778
|
udid: z.string().optional().describe("Optional simulator UDID. Uses booted simulator if not specified.")
|
|
@@ -3693,7 +3791,7 @@ server.registerTool("ios_key_sequence", {
|
|
|
3693
3791
|
});
|
|
3694
3792
|
// Tool: iOS describe all (accessibility tree)
|
|
3695
3793
|
server.registerTool("ios_describe_all", {
|
|
3696
|
-
description: "Get accessibility information for the entire iOS simulator screen. Returns a nested tree of UI elements with labels, values, and frames. Requires
|
|
3794
|
+
description: "Get accessibility information for the entire iOS simulator screen. Returns a nested tree of UI elements with labels, values, and frames. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3697
3795
|
inputSchema: {
|
|
3698
3796
|
udid: z.string().optional().describe("Optional simulator UDID. Uses booted simulator if not specified.")
|
|
3699
3797
|
}
|
|
@@ -3724,7 +3822,7 @@ server.registerTool("ios_describe_all", {
|
|
|
3724
3822
|
});
|
|
3725
3823
|
// Tool: iOS describe point
|
|
3726
3824
|
server.registerTool("ios_describe_point", {
|
|
3727
|
-
description: "Get accessibility information for the UI element at a specific point on the iOS simulator screen. Requires
|
|
3825
|
+
description: "Get accessibility information for the UI element at a specific point on the iOS simulator screen. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion).",
|
|
3728
3826
|
inputSchema: {
|
|
3729
3827
|
x: z.coerce.number().describe("X coordinate in pixels"),
|
|
3730
3828
|
y: z.coerce.number().describe("Y coordinate in pixels"),
|
|
@@ -3744,7 +3842,7 @@ server.registerTool("ios_describe_point", {
|
|
|
3744
3842
|
});
|
|
3745
3843
|
// Tool: iOS find element (no screenshot needed)
|
|
3746
3844
|
server.registerTool("ios_find_element", {
|
|
3747
|
-
description: "Find a UI element on iOS simulator by accessibility label or value. Returns element details including tap coordinates. Requires IDB (brew install idb-companion). Workflow: 1) wait_for_element, 2) find_element, 3) tap with returned coordinates. Prefer this over screenshots for button taps.",
|
|
3845
|
+
description: "Find a UI element on iOS simulator by accessibility label or value. Returns element details including tap coordinates. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion). Workflow: 1) wait_for_element, 2) find_element, 3) tap with returned coordinates. Prefer this over screenshots for button taps.",
|
|
3748
3846
|
inputSchema: {
|
|
3749
3847
|
label: z.string().optional().describe("Exact accessibility label match"),
|
|
3750
3848
|
labelContains: z.string().optional().describe("Partial label match (case-insensitive)"),
|
|
@@ -3791,7 +3889,7 @@ server.registerTool("ios_find_element", {
|
|
|
3791
3889
|
});
|
|
3792
3890
|
// Tool: iOS wait for element
|
|
3793
3891
|
server.registerTool("ios_wait_for_element", {
|
|
3794
|
-
description: "Wait for a UI element to appear on iOS simulator. Polls until found or timeout. Requires IDB (brew install idb-companion). Use this FIRST after navigation to ensure screen is ready, then use find_element + tap.",
|
|
3892
|
+
description: "Wait for a UI element to appear on iOS simulator. Polls until found or timeout. Requires an iOS UI driver: AXe (recommended: brew install cameroncooke/axe/axe) or IDB (brew install idb-companion). Use this FIRST after navigation to ensure screen is ready, then use find_element + tap.",
|
|
3795
3893
|
inputSchema: {
|
|
3796
3894
|
label: z.string().optional().describe("Exact accessibility label match"),
|
|
3797
3895
|
labelContains: z.string().optional().describe("Partial label match (case-insensitive)"),
|