react-native-ai-debugger 2.17.1 → 2.19.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 +1 -0
- package/build/__tests__/unit/actionLog.test.d.ts +2 -0
- package/build/__tests__/unit/actionLog.test.d.ts.map +1 -0
- package/build/__tests__/unit/actionLog.test.js +116 -0
- package/build/__tests__/unit/actionLog.test.js.map +1 -0
- package/build/__tests__/unit/chromiumNavigation.test.d.ts +2 -0
- package/build/__tests__/unit/chromiumNavigation.test.d.ts.map +1 -0
- package/build/__tests__/unit/chromiumNavigation.test.js +36 -0
- package/build/__tests__/unit/chromiumNavigation.test.js.map +1 -0
- package/build/__tests__/unit/commitRecorder.test.d.ts +2 -0
- package/build/__tests__/unit/commitRecorder.test.d.ts.map +1 -0
- package/build/__tests__/unit/commitRecorder.test.js +141 -0
- package/build/__tests__/unit/commitRecorder.test.js.map +1 -0
- package/build/__tests__/unit/commitRecorderInjected.test.d.ts +2 -0
- package/build/__tests__/unit/commitRecorderInjected.test.d.ts.map +1 -0
- package/build/__tests__/unit/commitRecorderInjected.test.js +195 -0
- package/build/__tests__/unit/commitRecorderInjected.test.js.map +1 -0
- package/build/__tests__/unit/epochStarts.test.d.ts +2 -0
- package/build/__tests__/unit/epochStarts.test.d.ts.map +1 -0
- package/build/__tests__/unit/epochStarts.test.js +35 -0
- package/build/__tests__/unit/epochStarts.test.js.map +1 -0
- package/build/__tests__/unit/networkInterceptorFetchMock.test.js +7 -0
- package/build/__tests__/unit/networkInterceptorFetchMock.test.js.map +1 -1
- package/build/__tests__/unit/networkMock.test.js +63 -0
- package/build/__tests__/unit/networkMock.test.js.map +1 -1
- package/build/__tests__/unit/networkMockTool.test.js +7 -0
- package/build/__tests__/unit/networkMockTool.test.js.map +1 -1
- package/build/__tests__/unit/redact.test.js +20 -2
- package/build/__tests__/unit/redact.test.js.map +1 -1
- package/build/__tests__/unit/sdkMirrorPoller.test.js +22 -0
- package/build/__tests__/unit/sdkMirrorPoller.test.js.map +1 -1
- package/build/__tests__/unit/textEntry.test.js +6 -0
- package/build/__tests__/unit/textEntry.test.js.map +1 -1
- package/build/__tests__/unit/timeline.test.d.ts +2 -0
- package/build/__tests__/unit/timeline.test.d.ts.map +1 -0
- package/build/__tests__/unit/timeline.test.js +157 -0
- package/build/__tests__/unit/timeline.test.js.map +1 -0
- package/build/__tests__/unit/timelineReadBounds.test.d.ts +2 -0
- package/build/__tests__/unit/timelineReadBounds.test.d.ts.map +1 -0
- package/build/__tests__/unit/timelineReadBounds.test.js +21 -0
- package/build/__tests__/unit/timelineReadBounds.test.js.map +1 -0
- package/build/__tests__/unit/timelineSources.test.d.ts +2 -0
- package/build/__tests__/unit/timelineSources.test.d.ts.map +1 -0
- package/build/__tests__/unit/timelineSources.test.js +139 -0
- package/build/__tests__/unit/timelineSources.test.js.map +1 -0
- package/build/__tests__/unit/timelineTool.test.d.ts +2 -0
- package/build/__tests__/unit/timelineTool.test.d.ts.map +1 -0
- package/build/__tests__/unit/timelineTool.test.js +65 -0
- package/build/__tests__/unit/timelineTool.test.js.map +1 -0
- package/build/__tests__/unit/vaultTools.test.js +17 -3
- package/build/__tests__/unit/vaultTools.test.js.map +1 -1
- package/build/core/actionLog.d.ts +27 -0
- package/build/core/actionLog.d.ts.map +1 -0
- package/build/core/actionLog.js +144 -0
- package/build/core/actionLog.js.map +1 -0
- package/build/core/chromiumCapabilities.js +1 -1
- package/build/core/chromiumCapabilities.js.map +1 -1
- package/build/core/chromiumNavigation.d.ts +10 -0
- package/build/core/chromiumNavigation.d.ts.map +1 -0
- package/build/core/chromiumNavigation.js +31 -0
- package/build/core/chromiumNavigation.js.map +1 -0
- package/build/core/chromiumScreen.d.ts.map +1 -1
- package/build/core/chromiumScreen.js +6 -8
- package/build/core/chromiumScreen.js.map +1 -1
- package/build/core/commitRecorder.d.ts +35 -0
- package/build/core/commitRecorder.d.ts.map +1 -0
- package/build/core/commitRecorder.js +115 -0
- package/build/core/commitRecorder.js.map +1 -0
- package/build/core/connection.d.ts.map +1 -1
- package/build/core/connection.js +13 -0
- package/build/core/connection.js.map +1 -1
- package/build/core/guides.d.ts.map +1 -1
- package/build/core/guides.js +5 -0
- package/build/core/guides.js.map +1 -1
- package/build/core/injected/commitRecorder.d.ts +2 -0
- package/build/core/injected/commitRecorder.d.ts.map +1 -0
- package/build/core/injected/commitRecorder.js +93 -0
- package/build/core/injected/commitRecorder.js.map +1 -0
- package/build/core/mockRules.d.ts +2 -0
- package/build/core/mockRules.d.ts.map +1 -1
- package/build/core/mockRules.js +9 -1
- package/build/core/mockRules.js.map +1 -1
- package/build/core/networkInterceptor.d.ts.map +1 -1
- package/build/core/networkInterceptor.js +49 -11
- package/build/core/networkInterceptor.js.map +1 -1
- package/build/core/redact.d.ts +2 -0
- package/build/core/redact.d.ts.map +1 -1
- package/build/core/redact.js +9 -0
- package/build/core/redact.js.map +1 -1
- package/build/core/register.d.ts.map +1 -1
- package/build/core/register.js +7 -1
- package/build/core/register.js.map +1 -1
- package/build/core/routeHistory.d.ts +3 -2
- package/build/core/routeHistory.d.ts.map +1 -1
- package/build/core/routeHistory.js +6 -6
- package/build/core/routeHistory.js.map +1 -1
- package/build/core/sdkMirrorPoller.d.ts.map +1 -1
- package/build/core/sdkMirrorPoller.js +21 -2
- package/build/core/sdkMirrorPoller.js.map +1 -1
- package/build/core/state.d.ts +4 -0
- package/build/core/state.d.ts.map +1 -1
- package/build/core/state.js +11 -0
- package/build/core/state.js.map +1 -1
- package/build/core/textEntry.d.ts +1 -1
- package/build/core/textEntry.d.ts.map +1 -1
- package/build/core/textEntry.js +5 -5
- package/build/core/textEntry.js.map +1 -1
- package/build/core/timeline.d.ts +59 -0
- package/build/core/timeline.d.ts.map +1 -0
- package/build/core/timeline.js +156 -0
- package/build/core/timeline.js.map +1 -0
- package/build/core/timelineSources.d.ts +30 -0
- package/build/core/timelineSources.d.ts.map +1 -0
- package/build/core/timelineSources.js +179 -0
- package/build/core/timelineSources.js.map +1 -0
- package/build/core/toolHelpers.d.ts +1 -0
- package/build/core/toolHelpers.d.ts.map +1 -1
- package/build/core/toolHelpers.js +1 -1
- package/build/core/toolHelpers.js.map +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -1
- package/build/index.js.map +1 -1
- package/build/tools/interactionTools.d.ts.map +1 -1
- package/build/tools/interactionTools.js +11 -5
- package/build/tools/interactionTools.js.map +1 -1
- package/build/tools/metaTools.d.ts.map +1 -1
- package/build/tools/metaTools.js +19 -1
- package/build/tools/metaTools.js.map +1 -1
- package/build/tools/networkTools.d.ts.map +1 -1
- package/build/tools/networkTools.js +22 -7
- package/build/tools/networkTools.js.map +1 -1
- package/build/tools/timelineTools.d.ts +3 -0
- package/build/tools/timelineTools.d.ts.map +1 -0
- package/build/tools/timelineTools.js +48 -0
- package/build/tools/timelineTools.js.map +1 -0
- package/package.json +1 -1
- package/tools.json +11 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { registerToolWithTelemetry } from "../core/register.js";
|
|
3
|
+
import { lastAction } from "../core/actionLog.js";
|
|
4
|
+
import { resolveWindow, trimEvents, formatTimeline, TIMELINE_SOURCES } from "../core/timeline.js";
|
|
5
|
+
import { collectTimeline } from "../core/timelineSources.js";
|
|
6
|
+
import { DEVICE_ALL_DESC } from "./_deviceArg.js";
|
|
7
|
+
const DEFAULT_LIMIT = 100;
|
|
8
|
+
export function registerTimelineTools(server) {
|
|
9
|
+
registerToolWithTelemetry(server, "get_timeline", {
|
|
10
|
+
description: "What happened, in order: your own actions, screen changes, network requests, console logs, app restarts and Fast Refresh edits in one time-ordered list.\n" +
|
|
11
|
+
"PURPOSE: Answer \"what did that cause?\" in one call instead of lining up get_logs, get_network_requests and get_screen_state by hand.\n" +
|
|
12
|
+
"WHEN TO USE: Right after a tap, navigate, input_text, reload_app or execute_in_app, to see its consequences; or with since=\"-5m\" to reconstruct how the app got into its current state.\n" +
|
|
13
|
+
"WORKFLOW: tap(...) -> get_timeline() -> get_request_details / get_log_details on the ids it prints.\n" +
|
|
14
|
+
"LIMITATIONS: Events are merged by time, not linked by cause. Shows only what the server captured (actions made through these tools, not by hand). Route and refresh times on Android and physical devices are corrected by an estimated clock offset.\n" +
|
|
15
|
+
"GOOD: get_timeline() after a tap; get_timeline({ since: \"-2m\", sources: [\"routes\", \"network\"] })\n" +
|
|
16
|
+
"BAD: get_timeline({ since: \"-1h\", limit: 500 }) as a first look; start from the last action.\n",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
since: z.union([z.number(), z.string()]).optional()
|
|
19
|
+
.describe('Window start: "last_action" (default), a relative time like "-30s" / "-5m" / "-1h", or epoch ms.'),
|
|
20
|
+
until: z.union([z.number(), z.string()]).optional()
|
|
21
|
+
.describe('Window end, same formats as since except "last_action". Default: now.'),
|
|
22
|
+
sources: z.array(z.enum(TIMELINE_SOURCES)).optional()
|
|
23
|
+
.describe("Subset of actions, routes, network, logs, restarts, refresh, perf. Default: all. Restarts are always shown. perf is reserved and returns nothing yet."),
|
|
24
|
+
limit: z.coerce.number().int().min(1).max(500).optional().default(DEFAULT_LIMIT)
|
|
25
|
+
.describe("Maximum events (default 100). Actions, routes, restarts and errors are kept first."),
|
|
26
|
+
device: z.string().optional().describe(DEVICE_ALL_DESC),
|
|
27
|
+
},
|
|
28
|
+
}, async ({ since, until, sources, limit, device }) => {
|
|
29
|
+
const window = resolveWindow({ since, until, now: Date.now(), lastAction: lastAction(device) });
|
|
30
|
+
const wanted = sources?.length ? sources : [...TIMELINE_SOURCES];
|
|
31
|
+
const collected = await collectTimeline({ device, sources: wanted, window });
|
|
32
|
+
if (wanted.every((s) => collected.unavailable.includes(s))) {
|
|
33
|
+
const text = `Timeline unavailable: ${collected.notes.join("; ")}`;
|
|
34
|
+
return { isError: true, content: [{ type: "text", text }], _errorMessage: text };
|
|
35
|
+
}
|
|
36
|
+
const { kept, dropped } = trimEvents(collected.events, limit ?? DEFAULT_LIMIT);
|
|
37
|
+
const notes = window.fallback
|
|
38
|
+
? ["No action recorded yet, so this shows the last 60s. Pass since to choose a window.", ...collected.notes]
|
|
39
|
+
: collected.notes;
|
|
40
|
+
const deviceLabel = collected.devices.length === 1 ? collected.devices[0]
|
|
41
|
+
: collected.devices.length === 0 ? "no devices" : "all devices";
|
|
42
|
+
const text = formatTimeline({
|
|
43
|
+
window, deviceLabel, events: kept, tagDevices: collected.devices.length > 1, dropped, notes, checked: wanted.filter((s) => s !== "perf"),
|
|
44
|
+
});
|
|
45
|
+
return { content: [{ type: "text", text }], _emptyResult: kept.length === 0 };
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=timelineTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timelineTools.js","sourceRoot":"","sources":["../../src/tools/timelineTools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAuB,MAAM,qBAAqB,CAAC;AACvH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CAAC,MAAiB;IACnD,yBAAyB,CACrB,MAAM,EACN,cAAc,EACd;QACI,WAAW,EACP,4JAA4J;YAC5J,0IAA0I;YAC1I,6LAA6L;YAC7L,uGAAuG;YACvG,yPAAyP;YACzP,0GAA0G;YAC1G,kGAAkG;QACtG,WAAW,EAAE;YACT,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,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AE,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IAC3F,CAAC,CACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ai-debugger",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"mcpName": "com.execbro/execbro",
|
|
5
5
|
"description": "React Native AI debugger: MCP server giving AI agents eyes and hands in your running app (logs, network, state inspection, tap, screenshot). Published as ExecBro.",
|
|
6
6
|
"type": "module",
|
package/tools.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generatedFrom": "toolRegistry",
|
|
3
|
-
"count":
|
|
3
|
+
"count": 68,
|
|
4
4
|
"tools": [
|
|
5
5
|
"activate_license",
|
|
6
6
|
"android_key_event",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"get_request_details",
|
|
34
34
|
"get_screen_layout",
|
|
35
35
|
"get_screen_state",
|
|
36
|
+
"get_timeline",
|
|
36
37
|
"get_usage_guide",
|
|
37
38
|
"handle_dialog",
|
|
38
39
|
"http_request",
|
|
@@ -247,6 +248,13 @@
|
|
|
247
248
|
"includeHistory",
|
|
248
249
|
"pressablesOnly"
|
|
249
250
|
],
|
|
251
|
+
"get_timeline": [
|
|
252
|
+
"device",
|
|
253
|
+
"limit",
|
|
254
|
+
"since",
|
|
255
|
+
"sources",
|
|
256
|
+
"until"
|
|
257
|
+
],
|
|
250
258
|
"get_usage_guide": [
|
|
251
259
|
"topic"
|
|
252
260
|
],
|
|
@@ -269,6 +277,7 @@
|
|
|
269
277
|
"index",
|
|
270
278
|
"native",
|
|
271
279
|
"replace",
|
|
280
|
+
"showKeyboard",
|
|
272
281
|
"testID",
|
|
273
282
|
"text",
|
|
274
283
|
"textMatch"
|
|
@@ -370,6 +379,7 @@
|
|
|
370
379
|
"method",
|
|
371
380
|
"mode",
|
|
372
381
|
"networkError",
|
|
382
|
+
"operation",
|
|
373
383
|
"remove",
|
|
374
384
|
"set",
|
|
375
385
|
"status",
|