react-native-ai-debugger 1.1.4 → 1.4.21
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/LICENSE +12 -1
- package/README.md +198 -1063
- package/build/__tests__/helpers/tap-test-helpers.d.ts +36 -0
- package/build/__tests__/helpers/tap-test-helpers.d.ts.map +1 -0
- package/build/__tests__/helpers/tap-test-helpers.js +130 -0
- package/build/__tests__/helpers/tap-test-helpers.js.map +1 -0
- package/build/__tests__/integration/connection-health.test.js +12 -6
- package/build/__tests__/integration/connection-health.test.js.map +1 -1
- package/build/__tests__/integration/execute-in-app.test.js +2 -1
- package/build/__tests__/integration/execute-in-app.test.js.map +1 -1
- package/build/__tests__/integration/tap-strategies.test.d.ts +2 -0
- package/build/__tests__/integration/tap-strategies.test.d.ts.map +1 -0
- package/build/__tests__/integration/tap-strategies.test.js +329 -0
- package/build/__tests__/integration/tap-strategies.test.js.map +1 -0
- package/build/__tests__/integration/tools.test.js +9 -10
- package/build/__tests__/integration/tools.test.js.map +1 -1
- package/build/__tests__/unit/burst.test.d.ts +2 -0
- package/build/__tests__/unit/burst.test.d.ts.map +1 -0
- package/build/__tests__/unit/burst.test.js +50 -0
- package/build/__tests__/unit/burst.test.js.map +1 -0
- package/build/__tests__/unit/connection-health.test.js +26 -16
- package/build/__tests__/unit/connection-health.test.js.map +1 -1
- package/build/__tests__/unit/fingerprint.test.d.ts +2 -0
- package/build/__tests__/unit/fingerprint.test.d.ts.map +1 -0
- package/build/__tests__/unit/fingerprint.test.js +89 -0
- package/build/__tests__/unit/fingerprint.test.js.map +1 -0
- package/build/__tests__/unit/imageBuffer.test.d.ts +2 -0
- package/build/__tests__/unit/imageBuffer.test.d.ts.map +1 -0
- package/build/__tests__/unit/imageBuffer.test.js +128 -0
- package/build/__tests__/unit/imageBuffer.test.js.map +1 -0
- package/build/__tests__/unit/logs.test.js +9 -0
- package/build/__tests__/unit/logs.test.js.map +1 -1
- package/build/__tests__/unit/networkInterceptor.test.d.ts +2 -0
- package/build/__tests__/unit/networkInterceptor.test.d.ts.map +1 -0
- package/build/__tests__/unit/networkInterceptor.test.js +104 -0
- package/build/__tests__/unit/networkInterceptor.test.js.map +1 -0
- package/build/__tests__/unit/screenshot-diff.test.d.ts +2 -0
- package/build/__tests__/unit/screenshot-diff.test.d.ts.map +1 -0
- package/build/__tests__/unit/screenshot-diff.test.js +97 -0
- package/build/__tests__/unit/screenshot-diff.test.js.map +1 -0
- package/build/__tests__/unit/tap.test.js +433 -28
- package/build/__tests__/unit/tap.test.js.map +1 -1
- package/build/core/android.d.ts.map +1 -1
- package/build/core/android.js +64 -29
- package/build/core/android.js.map +1 -1
- package/build/core/appDetection.d.ts +8 -0
- package/build/core/appDetection.d.ts.map +1 -0
- package/build/core/appDetection.js +91 -0
- package/build/core/appDetection.js.map +1 -0
- package/build/core/bundle.d.ts.map +1 -1
- package/build/core/bundle.js +15 -23
- package/build/core/bundle.js.map +1 -1
- package/build/core/config.d.ts +8 -0
- package/build/core/config.d.ts.map +1 -0
- package/build/core/config.js +27 -0
- package/build/core/config.js.map +1 -0
- package/build/core/connection.d.ts +47 -3
- package/build/core/connection.d.ts.map +1 -1
- package/build/core/connection.js +519 -124
- package/build/core/connection.js.map +1 -1
- package/build/core/executor.d.ts +57 -14
- package/build/core/executor.d.ts.map +1 -1
- package/build/core/executor.js +936 -208
- package/build/core/executor.js.map +1 -1
- package/build/core/fingerprint.d.ts +4 -0
- package/build/core/fingerprint.d.ts.map +1 -0
- package/build/core/fingerprint.js +47 -0
- package/build/core/fingerprint.js.map +1 -0
- package/build/core/guides.d.ts.map +1 -1
- package/build/core/guides.js +48 -9
- package/build/core/guides.js.map +1 -1
- package/build/core/httpServer.js.map +1 -1
- package/build/core/imageBuffer.d.ts +37 -0
- package/build/core/imageBuffer.d.ts.map +1 -0
- package/build/core/imageBuffer.js +58 -0
- package/build/core/imageBuffer.js.map +1 -0
- package/build/core/index.d.ts +21 -17
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +21 -19
- package/build/core/index.js.map +1 -1
- package/build/core/ios.d.ts +36 -7
- package/build/core/ios.d.ts.map +1 -1
- package/build/core/ios.js +553 -323
- package/build/core/ios.js.map +1 -1
- package/build/core/license.d.ts +38 -0
- package/build/core/license.d.ts.map +1 -0
- package/build/core/license.js +265 -0
- package/build/core/license.js.map +1 -0
- package/build/core/logbox.d.ts +51 -0
- package/build/core/logbox.d.ts.map +1 -0
- package/build/core/logbox.js +258 -0
- package/build/core/logbox.js.map +1 -0
- package/build/core/logs.d.ts +1 -0
- package/build/core/logs.d.ts.map +1 -1
- package/build/core/logs.js +5 -0
- package/build/core/logs.js.map +1 -1
- package/build/core/metro.d.ts +8 -0
- package/build/core/metro.d.ts.map +1 -1
- package/build/core/metro.js +28 -0
- package/build/core/metro.js.map +1 -1
- package/build/core/networkInterceptor.d.ts +30 -0
- package/build/core/networkInterceptor.d.ts.map +1 -0
- package/build/core/networkInterceptor.js +207 -0
- package/build/core/networkInterceptor.js.map +1 -0
- package/build/core/ocr.d.ts +8 -3
- package/build/core/ocr.d.ts.map +1 -1
- package/build/core/ocr.js +116 -15
- package/build/core/ocr.js.map +1 -1
- package/build/core/posthog.d.ts +5 -0
- package/build/core/posthog.d.ts.map +1 -0
- package/build/core/posthog.js +46 -0
- package/build/core/posthog.js.map +1 -0
- package/build/core/sdkBridge.d.ts +67 -0
- package/build/core/sdkBridge.d.ts.map +1 -0
- package/build/core/sdkBridge.js +148 -0
- package/build/core/sdkBridge.js.map +1 -0
- package/build/core/state.d.ts +26 -5
- package/build/core/state.d.ts.map +1 -1
- package/build/core/state.js +83 -10
- package/build/core/state.js.map +1 -1
- package/build/core/telemetry.d.ts +19 -1
- package/build/core/telemetry.d.ts.map +1 -1
- package/build/core/telemetry.js +165 -8
- package/build/core/telemetry.js.map +1 -1
- package/build/core/types.d.ts +11 -0
- package/build/core/types.d.ts.map +1 -1
- package/build/index.js +1304 -304
- package/build/index.js.map +1 -1
- package/build/pro/screenshot-diff.d.ts +10 -0
- package/build/pro/screenshot-diff.d.ts.map +1 -0
- package/build/pro/screenshot-diff.js +38 -0
- package/build/pro/screenshot-diff.js.map +1 -0
- package/build/pro/tap.d.ts +160 -0
- package/build/pro/tap.d.ts.map +1 -0
- package/build/pro/tap.js +1215 -0
- package/build/pro/tap.js.map +1 -0
- package/build/tools/accountTools.d.ts +44 -0
- package/build/tools/accountTools.d.ts.map +1 -0
- package/build/tools/accountTools.js +217 -0
- package/build/tools/accountTools.js.map +1 -0
- package/package.json +11 -8
- package/build/core/httpServer.js +0 -2459
- package/build/core/httpServerProcess.js +0 -153
- package/build/httpServerStandalone.js +0 -31
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP Server Process Manager
|
|
3
|
-
* Manages the standalone HTTP server as a child process for hot-reload capability
|
|
4
|
-
*/
|
|
5
|
-
import { spawn, execSync } from "child_process";
|
|
6
|
-
import { join, dirname } from "path";
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
8
|
-
let httpServerProcess = null;
|
|
9
|
-
let currentPort = null;
|
|
10
|
-
let isRestarting = false;
|
|
11
|
-
const DEFAULT_PORT = 9876;
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = dirname(__filename);
|
|
14
|
-
/**
|
|
15
|
-
* Kill any orphaned httpServerStandalone processes
|
|
16
|
-
*/
|
|
17
|
-
function killOrphanedProcesses() {
|
|
18
|
-
try {
|
|
19
|
-
if (process.platform === "win32") {
|
|
20
|
-
// Windows: use taskkill to find and kill node processes running httpServerStandalone
|
|
21
|
-
execSync("taskkill /F /FI \"IMAGENAME eq node.exe\" /FI \"WINDOWTITLE eq *httpServerStandalone*\" 2>nul || exit 0", { stdio: "ignore" });
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
// macOS/Linux: use pkill
|
|
25
|
-
execSync("pkill -f 'httpServerStandalone' 2>/dev/null || true", { stdio: "ignore" });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// Ignore errors - process may not exist
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Start the HTTP server as a child process
|
|
34
|
-
*/
|
|
35
|
-
export async function startHttpServerProcess(preferredPort = DEFAULT_PORT) {
|
|
36
|
-
// Always kill orphaned processes first (from previous sessions)
|
|
37
|
-
killOrphanedProcesses();
|
|
38
|
-
if (httpServerProcess) {
|
|
39
|
-
console.log("[HTTP Process] Server already running, stopping first...");
|
|
40
|
-
await stopHttpServerProcess();
|
|
41
|
-
}
|
|
42
|
-
// Wait for port to be released
|
|
43
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
const serverScript = join(__dirname, "..", "httpServerStandalone.js");
|
|
46
|
-
console.log(`[HTTP Process] Starting server process on port ${preferredPort}...`);
|
|
47
|
-
httpServerProcess = spawn("node", [serverScript], {
|
|
48
|
-
env: {
|
|
49
|
-
...process.env,
|
|
50
|
-
DEBUG_SERVER_PORT: String(preferredPort)
|
|
51
|
-
},
|
|
52
|
-
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
53
|
-
});
|
|
54
|
-
// Handle stdout
|
|
55
|
-
httpServerProcess.stdout?.on("data", (data) => {
|
|
56
|
-
const lines = data.toString().trim().split("\n");
|
|
57
|
-
for (const line of lines) {
|
|
58
|
-
console.log(line);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
// Handle stderr
|
|
62
|
-
httpServerProcess.stderr?.on("data", (data) => {
|
|
63
|
-
const lines = data.toString().trim().split("\n");
|
|
64
|
-
for (const line of lines) {
|
|
65
|
-
console.error(line);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
// Handle IPC messages from child
|
|
69
|
-
httpServerProcess.on("message", (msg) => {
|
|
70
|
-
if (msg.type === "ready" && msg.port) {
|
|
71
|
-
currentPort = msg.port;
|
|
72
|
-
console.log(`[HTTP Process] Server ready on port ${currentPort}`);
|
|
73
|
-
resolve(currentPort);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
// Handle process exit
|
|
77
|
-
httpServerProcess.on("exit", (code) => {
|
|
78
|
-
if (!isRestarting) {
|
|
79
|
-
console.log(`[HTTP Process] Server exited with code ${code}`);
|
|
80
|
-
}
|
|
81
|
-
httpServerProcess = null;
|
|
82
|
-
});
|
|
83
|
-
// Handle errors
|
|
84
|
-
httpServerProcess.on("error", (err) => {
|
|
85
|
-
console.error(`[HTTP Process] Error:`, err);
|
|
86
|
-
reject(err);
|
|
87
|
-
});
|
|
88
|
-
// Timeout if server doesn't start
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
if (!currentPort) {
|
|
91
|
-
reject(new Error("HTTP server startup timeout"));
|
|
92
|
-
}
|
|
93
|
-
}, 10000);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Stop the HTTP server process
|
|
98
|
-
*/
|
|
99
|
-
export async function stopHttpServerProcess() {
|
|
100
|
-
if (!httpServerProcess) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
return new Promise((resolve) => {
|
|
104
|
-
isRestarting = true;
|
|
105
|
-
httpServerProcess.on("exit", () => {
|
|
106
|
-
httpServerProcess = null;
|
|
107
|
-
currentPort = null;
|
|
108
|
-
isRestarting = false;
|
|
109
|
-
resolve();
|
|
110
|
-
});
|
|
111
|
-
httpServerProcess.kill("SIGTERM");
|
|
112
|
-
// Force kill after timeout
|
|
113
|
-
setTimeout(() => {
|
|
114
|
-
if (httpServerProcess) {
|
|
115
|
-
httpServerProcess.kill("SIGKILL");
|
|
116
|
-
httpServerProcess = null;
|
|
117
|
-
currentPort = null;
|
|
118
|
-
isRestarting = false;
|
|
119
|
-
resolve();
|
|
120
|
-
}
|
|
121
|
-
}, 3000);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Restart the HTTP server (for hot-reload)
|
|
126
|
-
*/
|
|
127
|
-
export async function restartHttpServerProcess() {
|
|
128
|
-
// Preserve port before stopping (stopHttpServerProcess resets currentPort)
|
|
129
|
-
const port = currentPort || DEFAULT_PORT;
|
|
130
|
-
console.log(`[HTTP Process] Restarting server for hot-reload on port ${port}...`);
|
|
131
|
-
// Kill orphaned processes first
|
|
132
|
-
killOrphanedProcesses();
|
|
133
|
-
// Wait for port to be released
|
|
134
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
135
|
-
// Start fresh (don't call stopHttpServerProcess as we already killed everything)
|
|
136
|
-
httpServerProcess = null;
|
|
137
|
-
currentPort = null;
|
|
138
|
-
isRestarting = false;
|
|
139
|
-
return startHttpServerProcess(port);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Get the current HTTP server port
|
|
143
|
-
*/
|
|
144
|
-
export function getHttpServerProcessPort() {
|
|
145
|
-
return currentPort;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Check if the HTTP server process is running
|
|
149
|
-
*/
|
|
150
|
-
export function isHttpServerProcessRunning() {
|
|
151
|
-
return httpServerProcess !== null && !httpServerProcess.killed;
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=httpServerProcess.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Standalone HTTP Debug Server
|
|
4
|
-
* Can be run independently and hot-reloaded without restarting the MCP session
|
|
5
|
-
*/
|
|
6
|
-
import { startDebugHttpServer } from "./core/index.js";
|
|
7
|
-
const PORT = parseInt(process.env.DEBUG_SERVER_PORT || "9876", 10);
|
|
8
|
-
console.log(`[HTTP Server] Starting standalone debug server on port ${PORT}...`);
|
|
9
|
-
startDebugHttpServer({ port: PORT })
|
|
10
|
-
.then((actualPort) => {
|
|
11
|
-
console.log(`[HTTP Server] Running at http://localhost:${actualPort}`);
|
|
12
|
-
console.log(`[HTTP Server] Ready for hot-reload. Restart this process to apply changes.`);
|
|
13
|
-
// Send port to parent process if spawned
|
|
14
|
-
if (process.send) {
|
|
15
|
-
process.send({ type: "ready", port: actualPort });
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
.catch((err) => {
|
|
19
|
-
console.error(`[HTTP Server] Failed to start:`, err);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
});
|
|
22
|
-
// Handle graceful shutdown
|
|
23
|
-
process.on("SIGTERM", () => {
|
|
24
|
-
console.log(`[HTTP Server] Shutting down...`);
|
|
25
|
-
process.exit(0);
|
|
26
|
-
});
|
|
27
|
-
process.on("SIGINT", () => {
|
|
28
|
-
console.log(`[HTTP Server] Interrupted, shutting down...`);
|
|
29
|
-
process.exit(0);
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=httpServerStandalone.js.map
|