@jshookmcp/jshook 0.2.2 → 0.2.3

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 (130) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +4 -4
  3. package/README.zh.md +3 -3
  4. package/dist/native/scripts/linux/enum-windows.sh +12 -12
  5. package/dist/native/scripts/macos/enum-windows.applescript +22 -22
  6. package/dist/native/scripts/windows/enum-windows-by-class.ps1 +51 -51
  7. package/dist/native/scripts/windows/enum-windows.ps1 +44 -44
  8. package/dist/native/scripts/windows/inject-dll.ps1 +21 -21
  9. package/dist/src/modules/analyzer/CodeAnalyzer.d.ts +1 -1
  10. package/dist/src/modules/analyzer/CodeAnalyzer.js +1 -1
  11. package/dist/src/modules/browser/BrowserDiscovery.d.ts +6 -5
  12. package/dist/src/modules/browser/BrowserDiscovery.js +1 -1
  13. package/dist/src/modules/browser/BrowserModeManager.d.ts +1 -1
  14. package/dist/src/modules/browser/BrowserModeManager.js +1 -1
  15. package/dist/src/modules/browser/UnifiedBrowserManager.js +1 -1
  16. package/dist/src/modules/captcha/AICaptchaDetector.d.ts +22 -22
  17. package/dist/src/modules/captcha/AICaptchaDetector.js +75 -75
  18. package/dist/src/modules/captcha/CaptchaDetector.d.ts +31 -17
  19. package/dist/src/modules/captcha/CaptchaDetector.js +1 -1
  20. package/dist/src/modules/collector/CodeCache.d.ts +2 -2
  21. package/dist/src/modules/collector/CodeCollector.d.ts +12 -9
  22. package/dist/src/modules/collector/CodeCollector.js +1 -1
  23. package/dist/src/modules/collector/DOMInspector.d.ts +3 -2
  24. package/dist/src/modules/collector/DOMInspector.js +1 -1
  25. package/dist/src/modules/crypto/CryptoDetector.d.ts +1 -1
  26. package/dist/src/modules/crypto/CryptoDetector.js +1 -1
  27. package/dist/src/modules/debugger/ScriptManager.impl.extract-function-tree.js +1 -1
  28. package/dist/src/modules/deobfuscator/Deobfuscator.d.ts +1 -1
  29. package/dist/src/modules/deobfuscator/Deobfuscator.js +1 -1
  30. package/dist/src/modules/deobfuscator/JSVMPDeobfuscator.restore.d.ts +1 -1
  31. package/dist/src/modules/deobfuscator/JSVMPDeobfuscator.restore.js +2 -2
  32. package/dist/src/modules/deobfuscator/PackerDeobfuscator.js +1 -1
  33. package/dist/src/modules/deobfuscator/VMDeobfuscator.d.ts +1 -1
  34. package/dist/src/modules/deobfuscator/VMDeobfuscator.js +82 -82
  35. package/dist/src/modules/emulator/AIEnvironmentAnalyzer.js +1 -1
  36. package/dist/src/modules/external/ExternalToolRunner.d.ts +1 -1
  37. package/dist/src/modules/external/ExternalToolRunner.js +1 -1
  38. package/dist/src/modules/hook/HookGeneratorBuilders.core.generators.compose.js +5 -5
  39. package/dist/src/modules/hook/HookGeneratorBuilders.core.generators.network.js +311 -311
  40. package/dist/src/modules/hook/HookGeneratorBuilders.core.generators.runtime.js +410 -410
  41. package/dist/src/modules/hook/HookGeneratorBuilders.core.generators.storage.js +122 -122
  42. package/dist/src/modules/monitor/ConsoleMonitor.impl.core.dynamic.js +194 -194
  43. package/dist/src/modules/monitor/PlaywrightNetworkMonitor.js +62 -62
  44. package/dist/src/modules/process/LinuxProcessManager.js +2 -2
  45. package/dist/src/modules/process/MacProcessManager.js +26 -26
  46. package/dist/src/modules/process/ProcessManager.impl.js +1 -1
  47. package/dist/src/modules/process/memory/availability.js +49 -49
  48. package/dist/src/modules/process/memory/injector.js +185 -185
  49. package/dist/src/modules/process/memory/reader.js +50 -50
  50. package/dist/src/modules/process/memory/regions.dump.js +51 -51
  51. package/dist/src/modules/process/memory/regions.enumerate.js +107 -107
  52. package/dist/src/modules/process/memory/regions.modules.js +80 -80
  53. package/dist/src/modules/process/memory/regions.protection.js +106 -106
  54. package/dist/src/modules/process/memory/scanner.darwin.js +41 -41
  55. package/dist/src/modules/process/memory/scanner.windows.js +124 -124
  56. package/dist/src/modules/process/memory/writer.js +54 -54
  57. package/dist/src/modules/security/ExecutionSandbox.js +44 -44
  58. package/dist/src/modules/stealth/StealthScripts.d.ts +3 -2
  59. package/dist/src/modules/stealth/StealthScripts.js +35 -1
  60. package/dist/src/modules/stealth/StealthVerifier.d.ts +1 -1
  61. package/dist/src/modules/stealth/StealthVerifier.js +1 -1
  62. package/dist/src/modules/trace/TraceDB.js +63 -63
  63. package/dist/src/native/CodeInjector.js +1 -1
  64. package/dist/src/native/HardwareBreakpoint.js +1 -1
  65. package/dist/src/server/MCPServer.js +1 -0
  66. package/dist/src/server/MCPServer.search.helpers.js +1 -1
  67. package/dist/src/server/MCPServer.tools.js +1 -1
  68. package/dist/src/server/ToolCallContextGuard.d.ts +5 -0
  69. package/dist/src/server/ToolCallContextGuard.js +77 -0
  70. package/dist/src/server/ToolRouter.d.ts +1 -1
  71. package/dist/src/server/ToolRouter.js +2 -2
  72. package/dist/src/server/domains/analysis/handlers.impl.d.ts +8 -8
  73. package/dist/src/server/domains/analysis/handlers.impl.js +8 -8
  74. package/dist/src/server/domains/analysis/handlers.web-tools.js +2 -2
  75. package/dist/src/server/domains/browser/definitions.tools.page-core.js +59 -59
  76. package/dist/src/server/domains/browser/definitions.tools.runtime.js +41 -41
  77. package/dist/src/server/domains/browser/definitions.tools.security.js +114 -114
  78. package/dist/src/server/domains/browser/handlers/facade-initializer.d.ts +3 -3
  79. package/dist/src/server/domains/browser/handlers/facade-initializer.js +3 -3
  80. package/dist/src/server/domains/browser/handlers/framework-state.js +210 -0
  81. package/dist/src/server/domains/browser/handlers/stealth-injection.js +8 -2
  82. package/dist/src/server/domains/browser/handlers.impl.d.ts +15 -11
  83. package/dist/src/server/domains/browser/handlers.impl.js +4 -4
  84. package/dist/src/server/domains/coordination/definitions.js +67 -0
  85. package/dist/src/server/domains/coordination/index.d.ts +18 -0
  86. package/dist/src/server/domains/coordination/index.js +132 -0
  87. package/dist/src/server/domains/coordination/manifest.js +15 -0
  88. package/dist/src/server/domains/graphql/handlers.impl.core.runtime.replay.js +2 -2
  89. package/dist/src/server/domains/graphql/handlers.impl.core.runtime.shared.js +77 -77
  90. package/dist/src/server/domains/hooks/ai-handlers.js +3 -3
  91. package/dist/src/server/domains/maintenance/handlers.d.ts +2 -2
  92. package/dist/src/server/domains/maintenance/handlers.js +2 -2
  93. package/dist/src/server/domains/platform/handlers/bridge-handlers.d.ts +1 -1
  94. package/dist/src/server/domains/platform/handlers/bridge-handlers.js +1 -1
  95. package/dist/src/server/domains/platform/handlers/miniapp-handlers.d.ts +1 -1
  96. package/dist/src/server/domains/platform/handlers/miniapp-handlers.js +1 -1
  97. package/dist/src/server/domains/process/handlers.impl.core.runtime.inject.js +1 -1
  98. package/dist/src/server/domains/trace/TraceSummarizer.d.ts +60 -0
  99. package/dist/src/server/domains/trace/TraceSummarizer.js +109 -0
  100. package/dist/src/server/domains/trace/definitions.tools.js +101 -71
  101. package/dist/src/server/domains/trace/handlers.d.ts +2 -1
  102. package/dist/src/server/domains/trace/handlers.js +59 -4
  103. package/dist/src/server/domains/trace/manifest.js +3 -1
  104. package/dist/src/server/domains/transform/handlers.impl.transform-base.js +103 -103
  105. package/dist/src/server/domains/wasm/handlers.js +2 -2
  106. package/dist/src/server/domains/workflow/handlers.impl.workflow-account-bundle.js +1 -1
  107. package/dist/src/server/domains/workflow/handlers.impl.workflow-api.js +51 -51
  108. package/dist/src/server/domains/workflow/handlers.impl.workflow-base.js +51 -51
  109. package/dist/src/server/extensions/ExtensionManager.roots.js +15 -5
  110. package/dist/src/server/http/HttpMiddleware.js +1 -1
  111. package/dist/src/server/registry/contracts.d.ts +6 -0
  112. package/dist/src/server/sandbox/MCPBridge.d.ts +9 -0
  113. package/dist/src/server/sandbox/MCPBridge.js +22 -0
  114. package/dist/src/server/sandbox/QuickJSSandbox.d.ts +4 -1
  115. package/dist/src/server/sandbox/QuickJSSandbox.js +149 -0
  116. package/dist/src/server/sandbox/SandboxHelpers.js +250 -250
  117. package/dist/src/server/sandbox/types.d.ts +13 -0
  118. package/dist/src/server/search/AffinityGraph.d.ts +7 -1
  119. package/dist/src/server/search/AffinityGraph.js +24 -3
  120. package/dist/src/services/LLMService.js +1 -1
  121. package/dist/src/utils/UnifiedCacheManager.d.ts +1 -1
  122. package/dist/src/utils/UnifiedCacheManager.js +2 -2
  123. package/dist/src/utils/cliFastPath.js +18 -4
  124. package/package.json +5 -3
  125. package/scripts/postinstall.cjs +37 -37
  126. package/src/native/scripts/linux/enum-windows.sh +12 -12
  127. package/src/native/scripts/macos/enum-windows.applescript +22 -22
  128. package/src/native/scripts/windows/enum-windows-by-class.ps1 +51 -51
  129. package/src/native/scripts/windows/enum-windows.ps1 +44 -44
  130. package/src/native/scripts/windows/inject-dll.ps1 +21 -21
@@ -300,38 +300,38 @@ export class PlaywrightNetworkMonitor {
300
300
  await this.evaluateInPage(script);
301
301
  }
302
302
  async injectXHRInterceptor(options) {
303
- const script = `
304
- (function() {
305
- if (window.__xhrInterceptorInjected) return;
306
- window.__xhrInterceptorInjected = true;
307
- const maxRecords = ${this.MAX_INJECTED_RECORDS};
308
- const OrigXHR = window.__pwOriginalXMLHttpRequest || window.XMLHttpRequest;
309
- window.__pwOriginalXMLHttpRequest = OrigXHR;
310
- if (!window.__xhrRequests) window.__xhrRequests = [];
311
- window.XMLHttpRequest = function() {
312
- const xhr = new OrigXHR();
313
- const origOpen = xhr.open.bind(xhr);
314
- const origSend = xhr.send.bind(xhr);
315
- xhr.open = function(method, url, ...rest) {
316
- xhr.__hookMeta = { method, url, timestamp: Date.now() };
317
- return origOpen(method, url, ...rest);
318
- };
319
- xhr.send = function(body) {
320
- xhr.addEventListener('load', function() {
321
- window.__xhrRequests.push({
322
- ...xhr.__hookMeta, body: body ? String(body).slice(0, 2048) : null,
323
- status: xhr.status, response: xhr.responseText.slice(0, 2048),
324
- });
325
- if (window.__xhrRequests.length > maxRecords) {
326
- window.__xhrRequests.splice(0, window.__xhrRequests.length - maxRecords);
327
- }
328
- });
329
- return origSend(body);
330
- };
331
- return xhr;
332
- };
333
- console.log('[PlaywrightXHR] XHR interceptor injected');
334
- })();
303
+ const script = `
304
+ (function() {
305
+ if (window.__xhrInterceptorInjected) return;
306
+ window.__xhrInterceptorInjected = true;
307
+ const maxRecords = ${this.MAX_INJECTED_RECORDS};
308
+ const OrigXHR = window.__pwOriginalXMLHttpRequest || window.XMLHttpRequest;
309
+ window.__pwOriginalXMLHttpRequest = OrigXHR;
310
+ if (!window.__xhrRequests) window.__xhrRequests = [];
311
+ window.XMLHttpRequest = function() {
312
+ const xhr = new OrigXHR();
313
+ const origOpen = xhr.open.bind(xhr);
314
+ const origSend = xhr.send.bind(xhr);
315
+ xhr.open = function(method, url, ...rest) {
316
+ xhr.__hookMeta = { method, url, timestamp: Date.now() };
317
+ return origOpen(method, url, ...rest);
318
+ };
319
+ xhr.send = function(body) {
320
+ xhr.addEventListener('load', function() {
321
+ window.__xhrRequests.push({
322
+ ...xhr.__hookMeta, body: body ? String(body).slice(0, 2048) : null,
323
+ status: xhr.status, response: xhr.responseText.slice(0, 2048),
324
+ });
325
+ if (window.__xhrRequests.length > maxRecords) {
326
+ window.__xhrRequests.splice(0, window.__xhrRequests.length - maxRecords);
327
+ }
328
+ });
329
+ return origSend(body);
330
+ };
331
+ return xhr;
332
+ };
333
+ console.log('[PlaywrightXHR] XHR interceptor injected');
334
+ })();
335
335
  `;
336
336
  if (options?.persistent) {
337
337
  await this.evaluateOnNewDocumentInPage(script);
@@ -341,36 +341,36 @@ export class PlaywrightNetworkMonitor {
341
341
  }
342
342
  }
343
343
  async injectFetchInterceptor(options) {
344
- const script = `
345
- (function() {
346
- if (window.__fetchInterceptorInjected) return;
347
- window.__fetchInterceptorInjected = true;
348
- const maxRecords = ${this.MAX_INJECTED_RECORDS};
349
- const origFetch = window.__pwOriginalFetch || window.fetch;
350
- window.__pwOriginalFetch = origFetch;
351
- if (!window.__fetchRequests) window.__fetchRequests = [];
352
- window.fetch = function(...args) {
353
- const [url, opts] = args;
354
- const entry = { url: String(url), method: opts?.method || 'GET', timestamp: Date.now() };
355
- return origFetch.apply(this, args).then(res => {
356
- entry.status = res.status;
357
- window.__fetchRequests.push(entry);
358
- if (window.__fetchRequests.length > maxRecords) {
359
- window.__fetchRequests.splice(0, window.__fetchRequests.length - maxRecords);
360
- }
361
- // Auto-persist compact summary so data survives context compression
362
- try {
363
- const s = { url: entry.url, method: entry.method, status: entry.status, ts: entry.timestamp };
364
- const prev = JSON.parse(localStorage.getItem('__capturedAPIs') || '[]');
365
- prev.push(s);
366
- if (prev.length > 500) prev.splice(0, prev.length - 500);
367
- localStorage.setItem('__capturedAPIs', JSON.stringify(prev));
368
- } catch(e) {}
369
- return res;
370
- });
371
- };
372
- console.log('[PlaywrightFetch] Fetch interceptor injected');
373
- })();
344
+ const script = `
345
+ (function() {
346
+ if (window.__fetchInterceptorInjected) return;
347
+ window.__fetchInterceptorInjected = true;
348
+ const maxRecords = ${this.MAX_INJECTED_RECORDS};
349
+ const origFetch = window.__pwOriginalFetch || window.fetch;
350
+ window.__pwOriginalFetch = origFetch;
351
+ if (!window.__fetchRequests) window.__fetchRequests = [];
352
+ window.fetch = function(...args) {
353
+ const [url, opts] = args;
354
+ const entry = { url: String(url), method: opts?.method || 'GET', timestamp: Date.now() };
355
+ return origFetch.apply(this, args).then(res => {
356
+ entry.status = res.status;
357
+ window.__fetchRequests.push(entry);
358
+ if (window.__fetchRequests.length > maxRecords) {
359
+ window.__fetchRequests.splice(0, window.__fetchRequests.length - maxRecords);
360
+ }
361
+ // Auto-persist compact summary so data survives context compression
362
+ try {
363
+ const s = { url: entry.url, method: entry.method, status: entry.status, ts: entry.timestamp };
364
+ const prev = JSON.parse(localStorage.getItem('__capturedAPIs') || '[]');
365
+ prev.push(s);
366
+ if (prev.length > 500) prev.splice(0, prev.length - 500);
367
+ localStorage.setItem('__capturedAPIs', JSON.stringify(prev));
368
+ } catch(e) {}
369
+ return res;
370
+ });
371
+ };
372
+ console.log('[PlaywrightFetch] Fetch interceptor injected');
373
+ })();
374
374
  `;
375
375
  if (options?.persistent) {
376
376
  await this.evaluateOnNewDocumentInPage(script);
@@ -214,7 +214,7 @@ export class LinuxProcessManager {
214
214
  const ppidMatch = status.match(/PPid:\s*(\d+)/);
215
215
  return {
216
216
  commandLine: cmdline.trim() || undefined,
217
- parentPid: ppidMatch && ppidMatch[1] ? parseInt(ppidMatch[1], 10) : undefined,
217
+ parentPid: ppidMatch?.[1] ? parseInt(ppidMatch[1], 10) : undefined,
218
218
  };
219
219
  }
220
220
  catch (error) {
@@ -228,7 +228,7 @@ export class LinuxProcessManager {
228
228
  const commandLine = options?.commandLine ?? (await this.getProcessCommandLine(pid)).commandLine;
229
229
  if (commandLine) {
230
230
  const match = commandLine.match(/--remote-debugging-port=(\d+)/);
231
- if (match && match[1]) {
231
+ if (match?.[1]) {
232
232
  return parseInt(match[1], 10);
233
233
  }
234
234
  }
@@ -109,31 +109,31 @@ export class MacProcessManager {
109
109
  if (!process) {
110
110
  return [];
111
111
  }
112
- const appleScript = `
113
- tell application "System Events"
114
- set processList to {}
115
- try
116
- set targetProcess to first process whose unix id is ${pid}
117
- set procName to name of targetProcess
118
- set windowList to {}
119
-
120
- tell targetProcess
121
- repeat with win in windows
122
- set winInfo to {|
123
- title:name of win,
124
- className:procName,
125
- processId:${pid},
126
- handle:"applescript-window"
127
- |}
128
- set end of windowList to winInfo
129
- end repeat
130
- end tell
131
-
132
- return windowList
133
- on error
134
- return {}
135
- end try
136
- end tell
112
+ const appleScript = `
113
+ tell application "System Events"
114
+ set processList to {}
115
+ try
116
+ set targetProcess to first process whose unix id is ${pid}
117
+ set procName to name of targetProcess
118
+ set windowList to {}
119
+
120
+ tell targetProcess
121
+ repeat with win in windows
122
+ set winInfo to {|
123
+ title:name of win,
124
+ className:procName,
125
+ processId:${pid},
126
+ handle:"applescript-window"
127
+ |}
128
+ set end of windowList to winInfo
129
+ end repeat
130
+ end tell
131
+
132
+ return windowList
133
+ on error
134
+ return {}
135
+ end try
136
+ end tell
137
137
  `;
138
138
  const { stdout } = await execAsync(`osascript -e '${appleScript.replace(/'/g, "'\"'\"'")}' 2>/dev/null || echo "[]"`, { timeout: 5000 });
139
139
  const windows = [];
@@ -275,7 +275,7 @@ export class MacProcessManager {
275
275
  const commandLine = options?.commandLine ?? (await this.getProcessCommandLine(pid)).commandLine;
276
276
  if (commandLine) {
277
277
  const match = commandLine.match(/--remote-debugging-port=(\d+)/);
278
- if (match && match[1]) {
278
+ if (match?.[1]) {
279
279
  return parseInt(match[1], 10);
280
280
  }
281
281
  }
@@ -189,7 +189,7 @@ export class ProcessManager {
189
189
  const commandLine = options?.commandLine ?? (await this.getProcessCommandLine(pid)).commandLine;
190
190
  if (commandLine) {
191
191
  const match = commandLine.match(/--remote-debugging-port=(\d+)/);
192
- if (match && match[1]) {
192
+ if (match?.[1]) {
193
193
  return parseInt(match[1], 10);
194
194
  }
195
195
  }
@@ -111,55 +111,55 @@ export async function checkDebugPort(platform, pid) {
111
111
  return { success: false, error: 'Debug port check currently only implemented for Windows' };
112
112
  }
113
113
  try {
114
- const psScript = `
115
- Add-Type @"
116
- using System;
117
- using System.Runtime.InteropServices;
118
- using System.ComponentModel;
119
-
120
- public class DebugChecker {
121
- [DllImport("ntdll.dll")]
122
- public static extern int NtQueryInformationProcess(IntPtr processHandle, int processInformationClass, out IntPtr processInformation, int processInformationLength, out int returnLength);
123
-
124
- [DllImport("kernel32.dll", SetLastError = true)]
125
- public static extern IntPtr OpenProcess(int access, bool inherit, int pid);
126
-
127
- [DllImport("kernel32.dll", SetLastError = true)]
128
- public static extern bool CloseHandle(IntPtr handle);
129
-
130
- const int PROCESS_QUERY_INFORMATION = 0x0400;
131
- const int ProcessDebugPort = 7;
132
-
133
- public static object Check(int pid) {
134
- IntPtr hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid);
135
- if (hProcess == IntPtr.Zero) {
136
- int error = Marshal.GetLastWin32Error();
137
- throw new Win32Exception(error, "Failed to open process");
138
- }
139
-
140
- try {
141
- IntPtr debugPort;
142
- int returnLength;
143
- int status = NtQueryInformationProcess(hProcess, ProcessDebugPort, out debugPort, IntPtr.Size, out returnLength);
144
-
145
- if (status != 0) {
146
- return new { success = false, error = "NtQueryInformationProcess failed with status: 0x" + status.ToString("X") };
147
- }
148
-
149
- return new { success = true, isDebugged = debugPort != IntPtr.Zero };
150
- } finally {
151
- CloseHandle(hProcess);
152
- }
153
- }
154
- }
155
- "@
156
-
157
- try {
158
- $result = [DebugChecker]::Check(${pid})
159
- $result | ConvertTo-Json -Compress
160
- } catch {
161
- @{ success = $false; error = $_.Exception.Message } | ConvertTo-Json -Compress
162
- }
114
+ const psScript = `
115
+ Add-Type @"
116
+ using System;
117
+ using System.Runtime.InteropServices;
118
+ using System.ComponentModel;
119
+
120
+ public class DebugChecker {
121
+ [DllImport("ntdll.dll")]
122
+ public static extern int NtQueryInformationProcess(IntPtr processHandle, int processInformationClass, out IntPtr processInformation, int processInformationLength, out int returnLength);
123
+
124
+ [DllImport("kernel32.dll", SetLastError = true)]
125
+ public static extern IntPtr OpenProcess(int access, bool inherit, int pid);
126
+
127
+ [DllImport("kernel32.dll", SetLastError = true)]
128
+ public static extern bool CloseHandle(IntPtr handle);
129
+
130
+ const int PROCESS_QUERY_INFORMATION = 0x0400;
131
+ const int ProcessDebugPort = 7;
132
+
133
+ public static object Check(int pid) {
134
+ IntPtr hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid);
135
+ if (hProcess == IntPtr.Zero) {
136
+ int error = Marshal.GetLastWin32Error();
137
+ throw new Win32Exception(error, "Failed to open process");
138
+ }
139
+
140
+ try {
141
+ IntPtr debugPort;
142
+ int returnLength;
143
+ int status = NtQueryInformationProcess(hProcess, ProcessDebugPort, out debugPort, IntPtr.Size, out returnLength);
144
+
145
+ if (status != 0) {
146
+ return new { success = false, error = "NtQueryInformationProcess failed with status: 0x" + status.ToString("X") };
147
+ }
148
+
149
+ return new { success = true, isDebugged = debugPort != IntPtr.Zero };
150
+ } finally {
151
+ CloseHandle(hProcess);
152
+ }
153
+ }
154
+ }
155
+ "@
156
+
157
+ try {
158
+ $result = [DebugChecker]::Check(${pid})
159
+ $result | ConvertTo-Json -Compress
160
+ } catch {
161
+ @{ success = $false; error = $_.Exception.Message } | ConvertTo-Json -Compress
162
+ }
163
163
  `;
164
164
  const { stdout } = await executePowerShellScript(psScript, {
165
165
  maxBuffer: 1024 * 1024,