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.
Files changed (144) hide show
  1. package/LICENSE +12 -1
  2. package/README.md +198 -1063
  3. package/build/__tests__/helpers/tap-test-helpers.d.ts +36 -0
  4. package/build/__tests__/helpers/tap-test-helpers.d.ts.map +1 -0
  5. package/build/__tests__/helpers/tap-test-helpers.js +130 -0
  6. package/build/__tests__/helpers/tap-test-helpers.js.map +1 -0
  7. package/build/__tests__/integration/connection-health.test.js +12 -6
  8. package/build/__tests__/integration/connection-health.test.js.map +1 -1
  9. package/build/__tests__/integration/execute-in-app.test.js +2 -1
  10. package/build/__tests__/integration/execute-in-app.test.js.map +1 -1
  11. package/build/__tests__/integration/tap-strategies.test.d.ts +2 -0
  12. package/build/__tests__/integration/tap-strategies.test.d.ts.map +1 -0
  13. package/build/__tests__/integration/tap-strategies.test.js +329 -0
  14. package/build/__tests__/integration/tap-strategies.test.js.map +1 -0
  15. package/build/__tests__/integration/tools.test.js +9 -10
  16. package/build/__tests__/integration/tools.test.js.map +1 -1
  17. package/build/__tests__/unit/burst.test.d.ts +2 -0
  18. package/build/__tests__/unit/burst.test.d.ts.map +1 -0
  19. package/build/__tests__/unit/burst.test.js +50 -0
  20. package/build/__tests__/unit/burst.test.js.map +1 -0
  21. package/build/__tests__/unit/connection-health.test.js +26 -16
  22. package/build/__tests__/unit/connection-health.test.js.map +1 -1
  23. package/build/__tests__/unit/fingerprint.test.d.ts +2 -0
  24. package/build/__tests__/unit/fingerprint.test.d.ts.map +1 -0
  25. package/build/__tests__/unit/fingerprint.test.js +89 -0
  26. package/build/__tests__/unit/fingerprint.test.js.map +1 -0
  27. package/build/__tests__/unit/imageBuffer.test.d.ts +2 -0
  28. package/build/__tests__/unit/imageBuffer.test.d.ts.map +1 -0
  29. package/build/__tests__/unit/imageBuffer.test.js +128 -0
  30. package/build/__tests__/unit/imageBuffer.test.js.map +1 -0
  31. package/build/__tests__/unit/logs.test.js +9 -0
  32. package/build/__tests__/unit/logs.test.js.map +1 -1
  33. package/build/__tests__/unit/networkInterceptor.test.d.ts +2 -0
  34. package/build/__tests__/unit/networkInterceptor.test.d.ts.map +1 -0
  35. package/build/__tests__/unit/networkInterceptor.test.js +104 -0
  36. package/build/__tests__/unit/networkInterceptor.test.js.map +1 -0
  37. package/build/__tests__/unit/screenshot-diff.test.d.ts +2 -0
  38. package/build/__tests__/unit/screenshot-diff.test.d.ts.map +1 -0
  39. package/build/__tests__/unit/screenshot-diff.test.js +97 -0
  40. package/build/__tests__/unit/screenshot-diff.test.js.map +1 -0
  41. package/build/__tests__/unit/tap.test.js +433 -28
  42. package/build/__tests__/unit/tap.test.js.map +1 -1
  43. package/build/core/android.d.ts.map +1 -1
  44. package/build/core/android.js +64 -29
  45. package/build/core/android.js.map +1 -1
  46. package/build/core/appDetection.d.ts +8 -0
  47. package/build/core/appDetection.d.ts.map +1 -0
  48. package/build/core/appDetection.js +91 -0
  49. package/build/core/appDetection.js.map +1 -0
  50. package/build/core/bundle.d.ts.map +1 -1
  51. package/build/core/bundle.js +15 -23
  52. package/build/core/bundle.js.map +1 -1
  53. package/build/core/config.d.ts +8 -0
  54. package/build/core/config.d.ts.map +1 -0
  55. package/build/core/config.js +27 -0
  56. package/build/core/config.js.map +1 -0
  57. package/build/core/connection.d.ts +47 -3
  58. package/build/core/connection.d.ts.map +1 -1
  59. package/build/core/connection.js +519 -124
  60. package/build/core/connection.js.map +1 -1
  61. package/build/core/executor.d.ts +57 -14
  62. package/build/core/executor.d.ts.map +1 -1
  63. package/build/core/executor.js +936 -208
  64. package/build/core/executor.js.map +1 -1
  65. package/build/core/fingerprint.d.ts +4 -0
  66. package/build/core/fingerprint.d.ts.map +1 -0
  67. package/build/core/fingerprint.js +47 -0
  68. package/build/core/fingerprint.js.map +1 -0
  69. package/build/core/guides.d.ts.map +1 -1
  70. package/build/core/guides.js +48 -9
  71. package/build/core/guides.js.map +1 -1
  72. package/build/core/httpServer.js.map +1 -1
  73. package/build/core/imageBuffer.d.ts +37 -0
  74. package/build/core/imageBuffer.d.ts.map +1 -0
  75. package/build/core/imageBuffer.js +58 -0
  76. package/build/core/imageBuffer.js.map +1 -0
  77. package/build/core/index.d.ts +21 -17
  78. package/build/core/index.d.ts.map +1 -1
  79. package/build/core/index.js +21 -19
  80. package/build/core/index.js.map +1 -1
  81. package/build/core/ios.d.ts +36 -7
  82. package/build/core/ios.d.ts.map +1 -1
  83. package/build/core/ios.js +553 -323
  84. package/build/core/ios.js.map +1 -1
  85. package/build/core/license.d.ts +38 -0
  86. package/build/core/license.d.ts.map +1 -0
  87. package/build/core/license.js +265 -0
  88. package/build/core/license.js.map +1 -0
  89. package/build/core/logbox.d.ts +51 -0
  90. package/build/core/logbox.d.ts.map +1 -0
  91. package/build/core/logbox.js +258 -0
  92. package/build/core/logbox.js.map +1 -0
  93. package/build/core/logs.d.ts +1 -0
  94. package/build/core/logs.d.ts.map +1 -1
  95. package/build/core/logs.js +5 -0
  96. package/build/core/logs.js.map +1 -1
  97. package/build/core/metro.d.ts +8 -0
  98. package/build/core/metro.d.ts.map +1 -1
  99. package/build/core/metro.js +28 -0
  100. package/build/core/metro.js.map +1 -1
  101. package/build/core/networkInterceptor.d.ts +30 -0
  102. package/build/core/networkInterceptor.d.ts.map +1 -0
  103. package/build/core/networkInterceptor.js +207 -0
  104. package/build/core/networkInterceptor.js.map +1 -0
  105. package/build/core/ocr.d.ts +8 -3
  106. package/build/core/ocr.d.ts.map +1 -1
  107. package/build/core/ocr.js +116 -15
  108. package/build/core/ocr.js.map +1 -1
  109. package/build/core/posthog.d.ts +5 -0
  110. package/build/core/posthog.d.ts.map +1 -0
  111. package/build/core/posthog.js +46 -0
  112. package/build/core/posthog.js.map +1 -0
  113. package/build/core/sdkBridge.d.ts +67 -0
  114. package/build/core/sdkBridge.d.ts.map +1 -0
  115. package/build/core/sdkBridge.js +148 -0
  116. package/build/core/sdkBridge.js.map +1 -0
  117. package/build/core/state.d.ts +26 -5
  118. package/build/core/state.d.ts.map +1 -1
  119. package/build/core/state.js +83 -10
  120. package/build/core/state.js.map +1 -1
  121. package/build/core/telemetry.d.ts +19 -1
  122. package/build/core/telemetry.d.ts.map +1 -1
  123. package/build/core/telemetry.js +165 -8
  124. package/build/core/telemetry.js.map +1 -1
  125. package/build/core/types.d.ts +11 -0
  126. package/build/core/types.d.ts.map +1 -1
  127. package/build/index.js +1304 -304
  128. package/build/index.js.map +1 -1
  129. package/build/pro/screenshot-diff.d.ts +10 -0
  130. package/build/pro/screenshot-diff.d.ts.map +1 -0
  131. package/build/pro/screenshot-diff.js +38 -0
  132. package/build/pro/screenshot-diff.js.map +1 -0
  133. package/build/pro/tap.d.ts +160 -0
  134. package/build/pro/tap.d.ts.map +1 -0
  135. package/build/pro/tap.js +1215 -0
  136. package/build/pro/tap.js.map +1 -0
  137. package/build/tools/accountTools.d.ts +44 -0
  138. package/build/tools/accountTools.d.ts.map +1 -0
  139. package/build/tools/accountTools.js +217 -0
  140. package/build/tools/accountTools.js.map +1 -0
  141. package/package.json +11 -8
  142. package/build/core/httpServer.js +0 -2459
  143. package/build/core/httpServerProcess.js +0 -153
  144. 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