@jshookmcp/jshook 0.3.0 → 0.3.1

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 (321) hide show
  1. package/README.md +25 -50
  2. package/README.zh.md +25 -48
  3. package/dist/AntiCheatDetector-CGVGNfy5.mjs +1 -0
  4. package/dist/CacheAdapters-CdAxBmVW.mjs +1 -0
  5. package/dist/CodeInjector-BlgyqTOk.mjs +1 -0
  6. package/dist/ConsoleMonitor-Dkqc0HNi.mjs +490 -0
  7. package/dist/DOMInspector-BYY_EJ0C.mjs +95 -0
  8. package/dist/DarwinAPI-DC4HGGLl.mjs +1 -0
  9. package/dist/DetailedDataManager-BniBJlVv.mjs +1 -0
  10. package/dist/EventBus-DgciURGg.mjs +1 -0
  11. package/dist/EvidenceGraphBridge-BIfgB7HP.mjs +1 -0
  12. package/dist/ExtensionManager-erMpqcLk.mjs +1 -0
  13. package/dist/FingerprintManager-N7BZqjxP.mjs +1 -0
  14. package/dist/HardwareBreakpoint-OcJqNFVc.mjs +1 -0
  15. package/dist/HeapAnalyzer-CqAxZzeS.mjs +1 -0
  16. package/dist/{HookGeneratorBuilders.core.generators.storage-CTbB4Lcx.mjs → HookGeneratorBuilders.core.generators.storage-Bf1fbrNK.mjs} +66 -101
  17. package/dist/InstrumentationSession-DxXs0sCp.mjs +1 -0
  18. package/dist/MCPServer.search.handlers.domain-DVbWL1bT.mjs +1 -0
  19. package/dist/MemoryController-BaqstM5w.mjs +2 -0
  20. package/dist/MemoryScanSession-CaxAjZJf.mjs +1 -0
  21. package/dist/MemoryScanner-BLYnMJy6.mjs +1 -0
  22. package/dist/NativeMemoryManager.impl-CI554XbY.mjs +1 -0
  23. package/dist/NativeMemoryManager.utils-DM4NC3FE.mjs +1 -0
  24. package/dist/PEAnalyzer-DJyaJTQJ.mjs +1 -0
  25. package/dist/PageController-D9jVkH0i.mjs +1 -0
  26. package/dist/PointerChainEngine-5nF9eNlu.mjs +1 -0
  27. package/dist/PrerequisiteError-Bl3dK8XA.mjs +1 -0
  28. package/dist/ProcessRegistry-Hf12LlR9.mjs +1 -0
  29. package/dist/ResponseBuilder-B2lu4KEl.mjs +1 -0
  30. package/dist/ReverseEvidenceGraph-B931HeoW.mjs +2 -0
  31. package/dist/ScriptManager-fgqiALgj.mjs +7 -0
  32. package/dist/Speedhack-l6s8L2Qw.mjs +1 -0
  33. package/dist/StealthVerifier-Dhbj4B4P.mjs +1 -0
  34. package/dist/StructureAnalyzer-A-WamfYE.mjs +2 -0
  35. package/dist/ToolCatalog-D_IKl1Hu.mjs +1 -0
  36. package/dist/ToolError-DWU_z7gp.mjs +1 -0
  37. package/dist/ToolProbe-xsfALmN3.mjs +1 -0
  38. package/dist/ToolRegistry-B0Zs-phN.mjs +1 -0
  39. package/dist/ToolRouter.policy-CFHoN_Lw.mjs +4 -0
  40. package/dist/TraceRecorder-Dd8jLXpi.mjs +272 -0
  41. package/dist/VersionDetector-DMoUWyNm.mjs +9 -0
  42. package/dist/Win32API-Bhi5xFBe.mjs +1 -0
  43. package/dist/Win32Debug-CQteFL4F.mjs +1 -0
  44. package/dist/WorkflowEngine-CxEp2WXH.mjs +1 -0
  45. package/dist/analysis-BuR-NgX8.mjs +5 -0
  46. package/dist/{antidebug-BRKeyt27.mjs → antidebug-BOTZH6-0.mjs} +8 -259
  47. package/dist/artifactRetention-NBdncOEW.mjs +1 -0
  48. package/dist/artifacts-B5xQuEa_.mjs +1 -0
  49. package/dist/authorization-schema-B40obG1A.mjs +1 -0
  50. package/dist/betterSqlite3-CGaxz4AX.mjs +1 -0
  51. package/dist/binary-instrument-Cf9qqLlM.mjs +7 -0
  52. package/dist/bind-helpers-BlAOQrFQ.mjs +1 -0
  53. package/dist/boringssl-inspector-BST5vtKx.mjs +2 -0
  54. package/dist/browser-C4Le3xqA.mjs +11 -0
  55. package/dist/capabilities-DbYCv-HF.mjs +1 -0
  56. package/dist/chunk-C_pMuVsO.mjs +1 -0
  57. package/dist/collector-CKO8RPK8.mjs +1 -0
  58. package/dist/concurrency-CcK46d0h.mjs +1 -0
  59. package/dist/constants-Cp6hBrrx.mjs +1 -0
  60. package/dist/coordination-BbijHEHH.mjs +1 -0
  61. package/dist/debugger-CRJq_krh.mjs +1 -0
  62. package/dist/definitions-BGobEDQa.mjs +1 -0
  63. package/dist/definitions-BGwNSkVm.mjs +1 -0
  64. package/dist/definitions-BbxOUiP-.mjs +1 -0
  65. package/dist/definitions-CCP9gphV.mjs +1 -0
  66. package/dist/definitions-CIO9O-Sw.mjs +1 -0
  67. package/dist/definitions-CYFbewnd.mjs +1 -0
  68. package/dist/definitions-CdWEuIkI.mjs +1 -0
  69. package/dist/definitions-CoQFbggH.mjs +1 -0
  70. package/dist/definitions-CuJRsJ6N.mjs +1 -0
  71. package/dist/definitions-DI9YXsJk.mjs +1 -0
  72. package/dist/definitions-DJklW2sS.mjs +1 -0
  73. package/dist/definitions-DZ8uKusP.mjs +1 -0
  74. package/dist/definitions-Dds_zrWx.mjs +1 -0
  75. package/dist/definitions-Dgrg7f3D.mjs +1 -0
  76. package/dist/definitions-DtE0XLrT.mjs +1 -0
  77. package/dist/definitions-LaYTuwQd.mjs +26 -0
  78. package/dist/definitions-NoVp_9Pm.mjs +1 -0
  79. package/dist/definitions-OvGsfxdt.mjs +1 -0
  80. package/dist/definitions-jXPaVy4P.mjs +1 -0
  81. package/dist/encoding-DGcr6Aj_.mjs +2 -0
  82. package/dist/ensure-browser-core-Buls24LQ.mjs +1 -0
  83. package/dist/evidence-graph-bridge-B0yhGPcs.mjs +1 -0
  84. package/dist/factory-Cx_1LorX.mjs +1 -0
  85. package/dist/flat-target-session-CO5g78k3.mjs +1 -0
  86. package/dist/formatAddress-C7j2fDlM.mjs +1 -0
  87. package/dist/graphql-HLf3MS8H.mjs +62 -0
  88. package/dist/handlers-BLMa4X7l.mjs +54 -0
  89. package/dist/handlers-BP12ZsWc.mjs +4 -0
  90. package/dist/handlers-BZoPla6E.mjs +1 -0
  91. package/dist/handlers-BggKiVx9.mjs +2 -0
  92. package/dist/handlers-D3iev8g1.mjs +1 -0
  93. package/dist/handlers-D49r1-1P.mjs +1 -0
  94. package/dist/handlers-DCE45Ww8.mjs +2 -0
  95. package/dist/handlers-DW5AbYs5.mjs +5 -0
  96. package/dist/handlers-De5u62Ga2.mjs +1 -0
  97. package/dist/handlers-DmQzIc44.mjs +31 -0
  98. package/dist/handlers-DnJRGp7t.mjs +302 -0
  99. package/dist/handlers-Dv_runVv.mjs +2 -0
  100. package/dist/handlers-S9Ws0IGy.mjs +2 -0
  101. package/dist/{handlers-Dz9PYsCa.mjs → handlers-pVNpaw4A.mjs} +118 -904
  102. package/dist/handlers.impl-CD2_kOcC.mjs +1 -0
  103. package/dist/hooks-DDKppogd.mjs +600 -0
  104. package/dist/index.mjs +12 -5235
  105. package/dist/logger-sBC6IdRT.mjs +1 -0
  106. package/dist/maintenance-CutEO84j.mjs +1 -0
  107. package/dist/manifest-BFGxlDRh.mjs +123 -0
  108. package/dist/manifest-BPuE6oH2.mjs +1 -0
  109. package/dist/manifest-BXry5N09.mjs +1 -0
  110. package/dist/manifest-BeP_zJGb2.mjs +1 -0
  111. package/dist/manifest-C0g67k6U.mjs +1 -0
  112. package/dist/manifest-C1nZkTkO.mjs +1 -0
  113. package/dist/manifest-C7qV1z7F.mjs +1 -0
  114. package/dist/manifest-CDeUZGUZ.mjs +1 -0
  115. package/dist/manifest-CDiCtaQT.mjs +1 -0
  116. package/dist/manifest-CFn0359q2.mjs +1 -0
  117. package/dist/manifest-CGq4NpqH2.mjs +1 -0
  118. package/dist/manifest-CJMGt7Qy.mjs +1 -0
  119. package/dist/manifest-CRIJq4Hs.mjs +1 -0
  120. package/dist/manifest-C_hEIjSx.mjs +1 -0
  121. package/dist/manifest-CeQmtQOY.mjs +1 -0
  122. package/dist/manifest-Cq0j7GZt.mjs +1 -0
  123. package/dist/manifest-CtPmHAdn.mjs +1 -0
  124. package/dist/manifest-Cx2IVMUY.mjs +1 -0
  125. package/dist/manifest-D16xPXro.mjs +1 -0
  126. package/dist/manifest-D44TaRJU.mjs +1 -0
  127. package/dist/manifest-D610kxZr.mjs +2 -0
  128. package/dist/manifest-DC-SMF6b.mjs +1 -0
  129. package/dist/manifest-DD3rtxvV.mjs +1 -0
  130. package/dist/manifest-DKUorv5M.mjs +1 -0
  131. package/dist/manifest-DMJlcsTR.mjs +1 -0
  132. package/dist/manifest-DWUUWBz0.mjs +1 -0
  133. package/dist/manifest-De-6Wf2R.mjs +1 -0
  134. package/dist/manifest-Dgh0uDW-.mjs +1 -0
  135. package/dist/manifest-Dm0o3i2U.mjs +1 -0
  136. package/dist/manifest-DsVh7Y4U.mjs +1 -0
  137. package/dist/manifest-DtEFSRaq.mjs +1 -0
  138. package/dist/manifest-H-EpAyZQ.mjs +1 -0
  139. package/dist/manifest-ais9Afrw.mjs +1 -0
  140. package/dist/manifest-tmb54wmA.mjs +1 -0
  141. package/dist/manifest-yu2xiQqe.mjs +1 -0
  142. package/dist/manifest-zrbrpKCC.mjs +1 -0
  143. package/dist/matchesWildcardPattern-BGqLSmEs.mjs +1 -0
  144. package/dist/modules-p-PUNv9r.mjs +332 -0
  145. package/dist/mojo-ipc-VGlv3Qyp.mjs +9 -0
  146. package/dist/network-BjZ1Y-GB.mjs +7 -0
  147. package/dist/outputPaths-BonGThuc.mjs +2 -0
  148. package/dist/parse-args-Cuk7-xUt.mjs +1 -0
  149. package/dist/platform-C446Lf97.mjs +93 -0
  150. package/dist/playwright-cdp-fallback-BwVR-_T3.mjs +1 -0
  151. package/dist/process-C9f2A5zk.mjs +962 -0
  152. package/dist/proxy-CvRepxgV.mjs +1 -0
  153. package/dist/registry-DUHIPE-v.mjs +1 -0
  154. package/dist/response-C7rKQst4.mjs +1 -0
  155. package/dist/search-defaults-D2bY-rzH.mjs +1 -0
  156. package/dist/server/plugin-api.mjs +1 -293
  157. package/dist/shared-state-board-Cyg-xh_k.mjs +1 -0
  158. package/dist/sourcemap-D6Q1UuAp.mjs +1 -0
  159. package/dist/ssrf-policy-T96MR3r6.mjs +1 -0
  160. package/dist/streaming-CTX58tbb.mjs +1 -0
  161. package/dist/tool-builder-CI9914Tf.mjs +1 -0
  162. package/dist/transform-Cv9P2vVD.mjs +103 -0
  163. package/dist/types-CuyefmGT.mjs +1 -0
  164. package/dist/types-DtThH00r.mjs +1 -0
  165. package/dist/wasm-DaJa8J0V.mjs +174 -0
  166. package/dist/webcrack-CsLLJIs9.mjs +46 -0
  167. package/dist/workflow-CYIXtrWD.mjs +101 -0
  168. package/package.json +50 -78
  169. package/dist/AntiCheatDetector-CqGDXmfc.mjs +0 -350
  170. package/dist/CacheAdapters-jJFy20G-.mjs +0 -80
  171. package/dist/CodeInjector-BdjRfNx7.mjs +0 -150
  172. package/dist/ConsoleMonitor-DykL3IAw.mjs +0 -2269
  173. package/dist/DarwinAPI-ETyy0xyo.mjs +0 -363
  174. package/dist/DetailedDataManager-HT49OrvF.mjs +0 -217
  175. package/dist/EventBus-DFKvADm3.mjs +0 -141
  176. package/dist/EvidenceGraphBridge-318Oi0Lf.mjs +0 -153
  177. package/dist/ExtensionManager-BDMsY2Dz.mjs +0 -721
  178. package/dist/FingerprintManager-BN4UQWnX.mjs +0 -96
  179. package/dist/HardwareBreakpoint-Cc2AFq1Y.mjs +0 -239
  180. package/dist/HeapAnalyzer-DruMgsgj.mjs +0 -284
  181. package/dist/InstrumentationSession-DLH0vd-z.mjs +0 -244
  182. package/dist/MemoryController-CMtviNW_.mjs +0 -167
  183. package/dist/MemoryScanSession-ITgb_NMi.mjs +0 -278
  184. package/dist/MemoryScanner-CiL7Z3ey.mjs +0 -428
  185. package/dist/NativeMemoryManager.impl-D9Lkovvn.mjs +0 -485
  186. package/dist/NativeMemoryManager.utils-BBlAixF5.mjs +0 -165
  187. package/dist/PEAnalyzer-DMQ44gen.mjs +0 -385
  188. package/dist/PageController-BPJNqqBN.mjs +0 -431
  189. package/dist/PointerChainEngine-K7wN8Z-w.mjs +0 -325
  190. package/dist/PrerequisiteError-TuyZIs6n.mjs +0 -20
  191. package/dist/ProcessRegistry-zGg12QbE.mjs +0 -74
  192. package/dist/ResponseBuilder-CJXWmWNw.mjs +0 -143
  193. package/dist/ReverseEvidenceGraph-C02-gXOh.mjs +0 -269
  194. package/dist/ScriptManager-ZuWD-0Jg.mjs +0 -3003
  195. package/dist/Speedhack-D-z0umeT.mjs +0 -156
  196. package/dist/StealthVerifier-BWmPgQsv.mjs +0 -135
  197. package/dist/StructureAnalyzer-Cav5AVSL.mjs +0 -429
  198. package/dist/ToolCatalog-5OJdMiF0.mjs +0 -582
  199. package/dist/ToolError-jh9whhMd.mjs +0 -15
  200. package/dist/ToolProbe-DbCFGyrg.mjs +0 -45
  201. package/dist/ToolRegistry-B9krbTtI.mjs +0 -180
  202. package/dist/ToolRouter.policy-BGDAGyeH.mjs +0 -344
  203. package/dist/TraceRecorder-B41Z5XBj.mjs +0 -1286
  204. package/dist/VersionDetector-K3V4vGsw.mjs +0 -104
  205. package/dist/Win32API-C2kjj0ze.mjs +0 -346
  206. package/dist/Win32Debug-CKrGOTpo.mjs +0 -274
  207. package/dist/WorkflowEngine-DJ6M4opp.mjs +0 -569
  208. package/dist/analysis-BHeJW2Nb.mjs +0 -1234
  209. package/dist/artifactRetention-CPXkUJXp.mjs +0 -598
  210. package/dist/artifacts-DkfosXH3.mjs +0 -59
  211. package/dist/authorization-schema-DRqyJMSk.mjs +0 -31
  212. package/dist/betterSqlite3-DLSBZodi.mjs +0 -74
  213. package/dist/binary-instrument--V3MAhJ4.mjs +0 -971
  214. package/dist/bind-helpers-ClV34xdn.mjs +0 -42
  215. package/dist/boringssl-inspector-Bo_LOLaS.mjs +0 -180
  216. package/dist/browser-Dx3_S2cG.mjs +0 -4369
  217. package/dist/capabilities-CcHlvWgK.mjs +0 -33
  218. package/dist/chunk-CjcI7cDX.mjs +0 -15
  219. package/dist/concurrency-Drev_Vz9.mjs +0 -41
  220. package/dist/constants-CDZLOoVv.mjs +0 -534
  221. package/dist/coordination-DgItD9DL.mjs +0 -259
  222. package/dist/debugger-RS3RSAqs.mjs +0 -1288
  223. package/dist/definitions-BEoYofW5.mjs +0 -47
  224. package/dist/definitions-BRaefg3u.mjs +0 -365
  225. package/dist/definitions-BbkvZkiv.mjs +0 -96
  226. package/dist/definitions-BtWSHJ3o.mjs +0 -17
  227. package/dist/definitions-C1gCHO0i.mjs +0 -43
  228. package/dist/definitions-CDOg_b-l.mjs +0 -138
  229. package/dist/definitions-CVPD9hzZ.mjs +0 -54
  230. package/dist/definitions-Cea8Lgl7.mjs +0 -94
  231. package/dist/definitions-DAgIyjxM.mjs +0 -10
  232. package/dist/definitions-DJA27nsL.mjs +0 -66
  233. package/dist/definitions-DKPFU3LW.mjs +0 -25
  234. package/dist/definitions-DPRpZQ96.mjs +0 -47
  235. package/dist/definitions-DUE5gmdn.mjs +0 -18
  236. package/dist/definitions-DYVjOtxa.mjs +0 -26
  237. package/dist/definitions-DcYLVLCo.mjs +0 -37
  238. package/dist/definitions-Pp5LI2H4.mjs +0 -27
  239. package/dist/definitions-j9KdHVNR.mjs +0 -14
  240. package/dist/definitions-uzkjBwa7.mjs +0 -258
  241. package/dist/definitions-va-AnLuQ.mjs +0 -28
  242. package/dist/encoding-DJeqHmpd.mjs +0 -1079
  243. package/dist/evidence-graph-bridge-DcYizFk2.mjs +0 -136
  244. package/dist/factory-C90tBff6.mjs +0 -575
  245. package/dist/flat-target-session-Dgax2Cy3.mjs +0 -29
  246. package/dist/formatAddress-nnMvEohD.mjs +0 -17
  247. package/dist/graphql-CoHrhweh.mjs +0 -1197
  248. package/dist/handlers-4jmR0nMs.mjs +0 -898
  249. package/dist/handlers-BAHPxcch.mjs +0 -789
  250. package/dist/handlers-BOs9b907.mjs +0 -2600
  251. package/dist/handlers-BWXEy6ef.mjs +0 -917
  252. package/dist/handlers-Bndn6QvE.mjs +0 -111
  253. package/dist/handlers-BqC4bD4s.mjs +0 -681
  254. package/dist/handlers-BtYq60bM2.mjs +0 -276
  255. package/dist/handlers-BzgcB4iv.mjs +0 -799
  256. package/dist/handlers-CRyRWj2b.mjs +0 -859
  257. package/dist/handlers-CVv2H1uq.mjs +0 -592
  258. package/dist/handlers-Dl5a7JS4.mjs +0 -572
  259. package/dist/handlers-Dx2d7jt7.mjs +0 -2537
  260. package/dist/handlers-HujRKC3b.mjs +0 -661
  261. package/dist/handlers.impl-XWXkQfyi.mjs +0 -807
  262. package/dist/hooks-B1B8NRHL.mjs +0 -898
  263. package/dist/logger-Dh_xb7_2.mjs +0 -93
  264. package/dist/maintenance-PRMkLVRW.mjs +0 -835
  265. package/dist/manifest-67Bok-Si.mjs +0 -58
  266. package/dist/manifest-6lNTMZAB2.mjs +0 -87
  267. package/dist/manifest-B2duEHiH.mjs +0 -90
  268. package/dist/manifest-B6EY9Vm8.mjs +0 -57
  269. package/dist/manifest-B6nKSbyY.mjs +0 -95
  270. package/dist/manifest-BL8AQNPF.mjs +0 -106
  271. package/dist/manifest-BSZvJJmV.mjs +0 -47
  272. package/dist/manifest-BU7qzUyX.mjs +0 -418
  273. package/dist/manifest-Bl62e8WK.mjs +0 -49
  274. package/dist/manifest-Bo5cXjdt.mjs +0 -82
  275. package/dist/manifest-BpS4gtUK.mjs +0 -1347
  276. package/dist/manifest-Bv65_e2W.mjs +0 -101
  277. package/dist/manifest-BytNIF4Z.mjs +0 -117
  278. package/dist/manifest-C-xtsjS3.mjs +0 -81
  279. package/dist/manifest-CDYl7OhA.mjs +0 -66
  280. package/dist/manifest-CRZ3xmkD.mjs +0 -61
  281. package/dist/manifest-CoW6u4Tp.mjs +0 -132
  282. package/dist/manifest-Cq5zN_8A.mjs +0 -50
  283. package/dist/manifest-D7YZM_2e.mjs +0 -194
  284. package/dist/manifest-DE_VrAeQ.mjs +0 -314
  285. package/dist/manifest-DGsXSCpT.mjs +0 -39
  286. package/dist/manifest-DJ2vfEuW.mjs +0 -156
  287. package/dist/manifest-DPXDYhEu.mjs +0 -80
  288. package/dist/manifest-Dd4fQb0a.mjs +0 -322
  289. package/dist/manifest-Deq6opGg.mjs +0 -223
  290. package/dist/manifest-DfJTafJK.mjs +0 -37
  291. package/dist/manifest-DgOdgN_j.mjs +0 -50
  292. package/dist/manifest-DlbMW4v4.mjs +0 -47
  293. package/dist/manifest-DmVfbH0w.mjs +0 -374
  294. package/dist/manifest-Dog6Ddjr.mjs +0 -109
  295. package/dist/manifest-DvgU5FWb.mjs +0 -58
  296. package/dist/manifest-HsfDBs7j.mjs +0 -50
  297. package/dist/manifest-I8oQHvCG.mjs +0 -186
  298. package/dist/manifest-NvH_a-av.mjs +0 -786
  299. package/dist/manifest-cEJU1v0Z.mjs +0 -129
  300. package/dist/manifest-wOl5XLB12.mjs +0 -112
  301. package/dist/modules-tZozf0LQ.mjs +0 -10635
  302. package/dist/mojo-ipc-DXNEXEqb.mjs +0 -640
  303. package/dist/network-CPVvwvFg.mjs +0 -3852
  304. package/dist/outputPaths-um7lCRY3.mjs +0 -1141
  305. package/dist/parse-args-B4cY5Vx5.mjs +0 -39
  306. package/dist/platform-CYeFoTWp.mjs +0 -2161
  307. package/dist/process-BTbgcVc6.mjs +0 -1306
  308. package/dist/proxy-r8YN6nP1.mjs +0 -192
  309. package/dist/registry-Bl8ZQW61.mjs +0 -34
  310. package/dist/response-CWhh2aLo.mjs +0 -34
  311. package/dist/shared-state-board-BoZnSoj-.mjs +0 -586
  312. package/dist/sourcemap-BIDHUVXy.mjs +0 -934
  313. package/dist/ssrf-policy-Dsqd-DTX.mjs +0 -166
  314. package/dist/streaming-Dal6utPp.mjs +0 -725
  315. package/dist/tool-builder-BHJp32mV.mjs +0 -186
  316. package/dist/transform-DRVgGG90.mjs +0 -1011
  317. package/dist/types-Bx92KJfT.mjs +0 -4
  318. package/dist/types-DDBWs9UP.mjs +0 -37
  319. package/dist/wasm-BYx5UOeG.mjs +0 -1044
  320. package/dist/webcrack-Be0_FccV.mjs +0 -747
  321. package/dist/workflow-BpuKEtvn.mjs +0 -725
@@ -1,1288 +0,0 @@
1
- import { t as logger } from "./logger-Dh_xb7_2.mjs";
2
- import { t as ToolError } from "./ToolError-jh9whhMd.mjs";
3
- import { a as argString, i as argObject, r as argNumber, t as argBool } from "./parse-args-B4cY5Vx5.mjs";
4
- import "./definitions-BbkvZkiv.mjs";
5
- //#region src/server/domains/debugger/handlers/debugger-control.ts
6
- var DebuggerControlHandlers = class {
7
- constructor(deps) {
8
- this.deps = deps;
9
- }
10
- async handleDebuggerLifecycle(args) {
11
- if (args.action === "enable") {
12
- await this.deps.debuggerManager.init();
13
- await this.deps.runtimeInspector.init();
14
- await this.deps.debuggerManager.initAdvancedFeatures(this.deps.runtimeInspector);
15
- return { content: [{
16
- type: "text",
17
- text: JSON.stringify({
18
- success: true,
19
- message: "Debugger enabled",
20
- enabled: this.deps.debuggerManager.isEnabled()
21
- }, null, 2)
22
- }] };
23
- } else {
24
- await this.deps.debuggerManager.disable();
25
- await this.deps.runtimeInspector.disable();
26
- return { content: [{
27
- type: "text",
28
- text: JSON.stringify({
29
- success: true,
30
- message: "Debugger disabled"
31
- }, null, 2)
32
- }] };
33
- }
34
- }
35
- async handleDebuggerPause(_args) {
36
- await this.deps.debuggerManager.pause();
37
- try {
38
- const pausedState = await this.deps.debuggerManager.waitForPaused(500);
39
- return { content: [{
40
- type: "text",
41
- text: JSON.stringify({
42
- success: true,
43
- paused: true,
44
- message: "Execution paused",
45
- reason: pausedState.reason,
46
- location: pausedState.callFrames[0]?.location
47
- }, null, 2)
48
- }] };
49
- } catch {
50
- return { content: [{
51
- type: "text",
52
- text: JSON.stringify({
53
- success: true,
54
- paused: false,
55
- message: "Pause requested; no paused event observed yet"
56
- }, null, 2)
57
- }] };
58
- }
59
- }
60
- async handleDebuggerResume(_args) {
61
- const wasPaused = this.deps.debuggerManager.getPausedState() !== null;
62
- await this.deps.debuggerManager.resume();
63
- return { content: [{
64
- type: "text",
65
- text: JSON.stringify({
66
- success: true,
67
- resumed: wasPaused,
68
- message: wasPaused ? "Execution resumed" : "Resume requested; debugger was not paused"
69
- }, null, 2)
70
- }] };
71
- }
72
- };
73
- //#endregion
74
- //#region src/server/domains/debugger/handlers/debugger-stepping.ts
75
- var DebuggerSteppingHandlers = class {
76
- constructor(deps) {
77
- this.deps = deps;
78
- }
79
- async handleDebuggerStepInto(_args) {
80
- const mgr = this.deps.debuggerManager;
81
- if (!mgr.isEnabled()) return { content: [{
82
- type: "text",
83
- text: JSON.stringify({
84
- success: false,
85
- error: "Debugger not enabled",
86
- hint: "Call debugger_lifecycle({ action: 'enable' })() first to enable the debugger"
87
- }, null, 2)
88
- }] };
89
- if (!mgr.isPaused()) return { content: [{
90
- type: "text",
91
- text: JSON.stringify({
92
- success: false,
93
- error: "Cannot step while not paused",
94
- hint: "The debugger must be paused at a breakpoint to perform step operations. Set one with breakpoint({ action: 'set', type: 'code', ... }) or pause with debugger_pause().",
95
- currentState: "running"
96
- }, null, 2)
97
- }] };
98
- try {
99
- await mgr.stepInto();
100
- return { content: [{
101
- type: "text",
102
- text: JSON.stringify({
103
- success: true,
104
- message: "Stepped into"
105
- }, null, 2)
106
- }] };
107
- } catch (error) {
108
- const errorMsg = error instanceof Error ? error.message : String(error);
109
- logger.error(`Step into failed: ${errorMsg}`);
110
- return { content: [{
111
- type: "text",
112
- text: JSON.stringify({
113
- success: false,
114
- error: errorMsg
115
- }, null, 2)
116
- }] };
117
- }
118
- }
119
- async handleDebuggerStepOver(_args) {
120
- const mgr = this.deps.debuggerManager;
121
- if (!mgr.isEnabled()) return { content: [{
122
- type: "text",
123
- text: JSON.stringify({
124
- success: false,
125
- error: "Debugger not enabled",
126
- hint: "Call debugger_lifecycle({ action: 'enable' })() first to enable the debugger"
127
- }, null, 2)
128
- }] };
129
- if (!mgr.isPaused()) return { content: [{
130
- type: "text",
131
- text: JSON.stringify({
132
- success: false,
133
- error: "Cannot step while not paused",
134
- hint: "The debugger must be paused at a breakpoint to perform step operations. Set one with breakpoint({ action: 'set', type: 'code', ... }) or pause with debugger_pause().",
135
- currentState: "running"
136
- }, null, 2)
137
- }] };
138
- try {
139
- await mgr.stepOver();
140
- return { content: [{
141
- type: "text",
142
- text: JSON.stringify({
143
- success: true,
144
- message: "Stepped over"
145
- }, null, 2)
146
- }] };
147
- } catch (error) {
148
- const errorMsg = error instanceof Error ? error.message : String(error);
149
- logger.error(`Step over failed: ${errorMsg}`);
150
- return { content: [{
151
- type: "text",
152
- text: JSON.stringify({
153
- success: false,
154
- error: errorMsg
155
- }, null, 2)
156
- }] };
157
- }
158
- }
159
- async handleDebuggerStepOut(_args) {
160
- const mgr = this.deps.debuggerManager;
161
- if (!mgr.isEnabled()) return { content: [{
162
- type: "text",
163
- text: JSON.stringify({
164
- success: false,
165
- error: "Debugger not enabled",
166
- hint: "Call debugger_lifecycle({ action: 'enable' })() first to enable the debugger"
167
- }, null, 2)
168
- }] };
169
- if (!mgr.isPaused()) return { content: [{
170
- type: "text",
171
- text: JSON.stringify({
172
- success: false,
173
- error: "Cannot step out while not paused",
174
- hint: "The debugger must be paused at a breakpoint to perform step out. Set one with breakpoint({ action: 'set', type: 'code', ... }) or pause with debugger_pause().",
175
- currentState: "running"
176
- }, null, 2)
177
- }] };
178
- try {
179
- await mgr.stepOut();
180
- return { content: [{
181
- type: "text",
182
- text: JSON.stringify({
183
- success: true,
184
- message: "Stepped out"
185
- }, null, 2)
186
- }] };
187
- } catch (error) {
188
- const errorMsg = error instanceof Error ? error.message : String(error);
189
- logger.error(`Step out failed: ${errorMsg}`);
190
- return { content: [{
191
- type: "text",
192
- text: JSON.stringify({
193
- success: false,
194
- error: errorMsg
195
- }, null, 2)
196
- }] };
197
- }
198
- }
199
- };
200
- //#endregion
201
- //#region src/server/domains/debugger/handlers/debugger-evaluate.ts
202
- var DebuggerEvaluateHandlers = class {
203
- constructor(deps) {
204
- this.deps = deps;
205
- }
206
- async handleDebuggerEvaluate(args) {
207
- const expression = argString(args, "expression", "");
208
- const callFrameId = argString(args, "callFrameId");
209
- const result = await this.deps.runtimeInspector.evaluate(expression, callFrameId);
210
- return { content: [{
211
- type: "text",
212
- text: JSON.stringify({
213
- success: true,
214
- expression,
215
- result
216
- }, null, 2)
217
- }] };
218
- }
219
- async handleDebuggerEvaluateGlobal(args) {
220
- const expression = argString(args, "expression", "");
221
- const result = await this.deps.runtimeInspector.evaluateGlobal(expression);
222
- return { content: [{
223
- type: "text",
224
- text: JSON.stringify({
225
- success: true,
226
- expression,
227
- result
228
- }, null, 2)
229
- }] };
230
- }
231
- };
232
- //#endregion
233
- //#region src/server/domains/debugger/handlers/debugger-state.ts
234
- var DebuggerStateHandlers = class {
235
- constructor(deps) {
236
- this.deps = deps;
237
- }
238
- async handleDebuggerWaitForPaused(args) {
239
- const timeout = argNumber(args, "timeout", 3e4);
240
- try {
241
- const pausedState = await this.deps.debuggerManager.waitForPaused(timeout);
242
- return { content: [{
243
- type: "text",
244
- text: JSON.stringify({
245
- success: true,
246
- paused: true,
247
- reason: pausedState.reason,
248
- location: pausedState.callFrames[0]?.location,
249
- hitBreakpoints: pausedState.hitBreakpoints
250
- }, null, 2)
251
- }] };
252
- } catch (error) {
253
- if (error instanceof ToolError) throw error;
254
- return { content: [{
255
- type: "text",
256
- text: JSON.stringify({
257
- success: false,
258
- paused: false,
259
- message: error instanceof Error ? error.message : "Timeout waiting for paused event"
260
- }, null, 2)
261
- }] };
262
- }
263
- }
264
- async handleDebuggerGetPausedState(_args) {
265
- const pausedState = this.deps.debuggerManager.getPausedState();
266
- if (!pausedState) return { content: [{
267
- type: "text",
268
- text: JSON.stringify({
269
- paused: false,
270
- message: "Debugger is not paused"
271
- }, null, 2)
272
- }] };
273
- return { content: [{
274
- type: "text",
275
- text: JSON.stringify({
276
- paused: true,
277
- reason: pausedState.reason,
278
- frameCount: pausedState.callFrames.length,
279
- topFrame: {
280
- functionName: pausedState.callFrames[0]?.functionName,
281
- location: pausedState.callFrames[0]?.location
282
- },
283
- hitBreakpoints: pausedState.hitBreakpoints,
284
- timestamp: pausedState.timestamp
285
- }, null, 2)
286
- }] };
287
- }
288
- async handleGetCallStack(_args) {
289
- const callStack = await this.deps.runtimeInspector.getCallStack();
290
- if (!callStack) return { content: [{
291
- type: "text",
292
- text: JSON.stringify({
293
- success: false,
294
- message: "Not in paused state. Set a breakpoint and trigger it first."
295
- }, null, 2)
296
- }] };
297
- return { content: [{
298
- type: "text",
299
- text: JSON.stringify({
300
- success: true,
301
- callStack: {
302
- frameCount: callStack.callFrames.length,
303
- reason: callStack.reason,
304
- frames: callStack.callFrames.map((frame, index) => ({
305
- index,
306
- callFrameId: frame.callFrameId,
307
- functionName: frame.functionName,
308
- location: `${frame.location.url}:${frame.location.lineNumber}:${frame.location.columnNumber}`,
309
- scopeCount: frame.scopeChain.length
310
- }))
311
- }
312
- }, null, 2)
313
- }] };
314
- }
315
- };
316
- //#endregion
317
- //#region src/server/domains/debugger/handlers/session-management.ts
318
- function getErrorMessage$5(error) {
319
- if (typeof error === "object" && error !== null && "message" in error) {
320
- const message = error.message;
321
- if (typeof message === "string" && message.length > 0) return message;
322
- }
323
- return String(error);
324
- }
325
- var SessionManagementHandlers = class {
326
- constructor(deps) {
327
- this.deps = deps;
328
- }
329
- async handleSaveSession(args) {
330
- const filePath = argString(args, "filePath");
331
- const metadata = argObject(args, "metadata");
332
- try {
333
- const savedPath = await this.deps.debuggerManager.saveSession(filePath, metadata);
334
- return { content: [{
335
- type: "text",
336
- text: JSON.stringify({
337
- success: true,
338
- message: "Session saved successfully",
339
- filePath: savedPath,
340
- breakpointCount: this.deps.debuggerManager.listBreakpoints().length
341
- }, null, 2)
342
- }] };
343
- } catch (error) {
344
- return { content: [{
345
- type: "text",
346
- text: JSON.stringify({
347
- success: false,
348
- message: "Failed to save session",
349
- error: getErrorMessage$5(error)
350
- }, null, 2)
351
- }] };
352
- }
353
- }
354
- async handleLoadSession(args) {
355
- const filePath = argString(args, "filePath");
356
- const sessionData = argString(args, "sessionData");
357
- try {
358
- if (filePath) await this.deps.debuggerManager.loadSessionFromFile(filePath);
359
- else if (sessionData) await this.deps.debuggerManager.importSession(sessionData);
360
- else throw new Error("Either filePath or sessionData must be provided");
361
- return { content: [{
362
- type: "text",
363
- text: JSON.stringify({
364
- success: true,
365
- message: "Session loaded successfully",
366
- breakpointCount: this.deps.debuggerManager.listBreakpoints().length,
367
- pauseOnExceptions: this.deps.debuggerManager.getPauseOnExceptionsState()
368
- }, null, 2)
369
- }] };
370
- } catch (error) {
371
- return { content: [{
372
- type: "text",
373
- text: JSON.stringify({
374
- success: false,
375
- message: "Failed to load session",
376
- error: getErrorMessage$5(error)
377
- }, null, 2)
378
- }] };
379
- }
380
- }
381
- async handleExportSession(args) {
382
- const metadata = argObject(args, "metadata");
383
- try {
384
- const session = this.deps.debuggerManager.exportSession(metadata);
385
- return { content: [{
386
- type: "text",
387
- text: JSON.stringify({
388
- success: true,
389
- message: "Session exported successfully",
390
- session
391
- }, null, 2)
392
- }] };
393
- } catch (error) {
394
- return { content: [{
395
- type: "text",
396
- text: JSON.stringify({
397
- success: false,
398
- message: "Failed to export session",
399
- error: getErrorMessage$5(error)
400
- }, null, 2)
401
- }] };
402
- }
403
- }
404
- async handleListSessions(_args) {
405
- try {
406
- const sessions = await this.deps.debuggerManager.listSavedSessions();
407
- return { content: [{
408
- type: "text",
409
- text: JSON.stringify({
410
- success: true,
411
- count: sessions.length,
412
- sessions: sessions.map((s) => ({
413
- path: s.path,
414
- timestamp: s.timestamp,
415
- date: new Date(s.timestamp).toISOString(),
416
- metadata: s.metadata
417
- }))
418
- }, null, 2)
419
- }] };
420
- } catch (error) {
421
- return { content: [{
422
- type: "text",
423
- text: JSON.stringify({
424
- success: false,
425
- message: "Failed to list sessions",
426
- error: getErrorMessage$5(error)
427
- }, null, 2)
428
- }] };
429
- }
430
- }
431
- };
432
- //#endregion
433
- //#region src/server/domains/debugger/handlers/breakpoint-basic.ts
434
- var BreakpointBasicHandlers = class {
435
- constructor(deps) {
436
- this.deps = deps;
437
- }
438
- async handleBreakpointSet(args) {
439
- const url = argString(args, "url");
440
- const scriptId = argString(args, "scriptId");
441
- const lineNumber = argNumber(args, "lineNumber", 0);
442
- const columnNumber = argNumber(args, "columnNumber");
443
- const condition = argString(args, "condition");
444
- let breakpoint;
445
- if (url) breakpoint = await this.deps.debuggerManager.setBreakpointByUrl({
446
- url,
447
- lineNumber,
448
- columnNumber,
449
- condition
450
- });
451
- else if (scriptId) breakpoint = await this.deps.debuggerManager.setBreakpoint({
452
- scriptId,
453
- lineNumber,
454
- columnNumber,
455
- condition
456
- });
457
- else throw new Error("Either url or scriptId must be provided");
458
- this.deps.eventBus?.emit("debugger:breakpoint_hit", {
459
- scriptId: breakpoint.location?.scriptId ?? scriptId ?? "",
460
- lineNumber: breakpoint.location?.lineNumber ?? lineNumber,
461
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
462
- });
463
- return { content: [{
464
- type: "text",
465
- text: JSON.stringify({
466
- success: true,
467
- breakpoint: {
468
- breakpointId: breakpoint.breakpointId,
469
- location: breakpoint.location,
470
- condition: breakpoint.condition,
471
- enabled: breakpoint.enabled
472
- }
473
- }, null, 2)
474
- }] };
475
- }
476
- async handleBreakpointRemove(args) {
477
- const breakpointId = argString(args, "breakpointId", "");
478
- await this.deps.debuggerManager.removeBreakpoint(breakpointId);
479
- return { content: [{
480
- type: "text",
481
- text: JSON.stringify({
482
- success: true,
483
- message: `Breakpoint ${breakpointId} removed`
484
- }, null, 2)
485
- }] };
486
- }
487
- async handleBreakpointList(_args) {
488
- const breakpoints = this.deps.debuggerManager.listBreakpoints();
489
- return { content: [{
490
- type: "text",
491
- text: JSON.stringify({
492
- count: breakpoints.length,
493
- breakpoints: breakpoints.map((bp) => ({
494
- breakpointId: bp.breakpointId,
495
- location: bp.location,
496
- condition: bp.condition,
497
- enabled: bp.enabled,
498
- hitCount: bp.hitCount
499
- }))
500
- }, null, 2)
501
- }] };
502
- }
503
- };
504
- //#endregion
505
- //#region src/server/domains/debugger/handlers/breakpoint-exception.ts
506
- var BreakpointExceptionHandlers = class {
507
- constructor(deps) {
508
- this.deps = deps;
509
- }
510
- async handleBreakpointSetOnException(args) {
511
- const state = argString(args, "state", "none");
512
- await this.deps.debuggerManager.setPauseOnExceptions(state);
513
- return { content: [{
514
- type: "text",
515
- text: JSON.stringify({
516
- success: true,
517
- message: `Pause on exceptions set to: ${state}`,
518
- state
519
- }, null, 2)
520
- }] };
521
- }
522
- };
523
- //#endregion
524
- //#region src/server/domains/debugger/handlers/xhr-breakpoint.ts
525
- function hasEnsureAdvancedFeatures$2(manager) {
526
- return typeof manager.ensureAdvancedFeatures === "function";
527
- }
528
- function getErrorMessage$4(error) {
529
- if (typeof error === "object" && error !== null && "message" in error) {
530
- const message = error.message;
531
- if (typeof message === "string" && message.length > 0) return message;
532
- }
533
- return String(error);
534
- }
535
- var XHRBreakpointHandlers = class {
536
- constructor(deps) {
537
- this.deps = deps;
538
- }
539
- async ensureAdvancedFeaturesIfSupported() {
540
- if (hasEnsureAdvancedFeatures$2(this.deps.debuggerManager)) await this.deps.debuggerManager.ensureAdvancedFeatures();
541
- }
542
- async handleXHRBreakpointSet(args) {
543
- try {
544
- const urlPattern = argString(args, "urlPattern", "");
545
- await this.ensureAdvancedFeaturesIfSupported();
546
- const breakpointId = await this.deps.debuggerManager.getXHRManager().setXHRBreakpoint(urlPattern);
547
- return { content: [{
548
- type: "text",
549
- text: JSON.stringify({
550
- success: true,
551
- message: "XHR breakpoint set",
552
- breakpointId,
553
- urlPattern
554
- }, null, 2)
555
- }] };
556
- } catch (error) {
557
- return { content: [{
558
- type: "text",
559
- text: JSON.stringify({
560
- success: false,
561
- message: "Failed to set XHR breakpoint",
562
- error: getErrorMessage$4(error)
563
- }, null, 2)
564
- }] };
565
- }
566
- }
567
- async handleXHRBreakpointRemove(args) {
568
- try {
569
- const breakpointId = argString(args, "breakpointId", "");
570
- await this.ensureAdvancedFeaturesIfSupported();
571
- const removed = await this.deps.debuggerManager.getXHRManager().removeXHRBreakpoint(breakpointId);
572
- return { content: [{
573
- type: "text",
574
- text: JSON.stringify({
575
- success: removed,
576
- message: removed ? "XHR breakpoint removed" : "XHR breakpoint not found",
577
- breakpointId
578
- }, null, 2)
579
- }] };
580
- } catch (error) {
581
- return { content: [{
582
- type: "text",
583
- text: JSON.stringify({
584
- success: false,
585
- message: "Failed to remove XHR breakpoint",
586
- error: getErrorMessage$4(error)
587
- }, null, 2)
588
- }] };
589
- }
590
- }
591
- async handleXHRBreakpointList(_args) {
592
- try {
593
- await this.ensureAdvancedFeaturesIfSupported();
594
- const breakpoints = this.deps.debuggerManager.getXHRManager().getAllXHRBreakpoints();
595
- return { content: [{
596
- type: "text",
597
- text: JSON.stringify({
598
- success: true,
599
- message: `Found ${breakpoints.length} XHR breakpoint(s)`,
600
- breakpoints
601
- }, null, 2)
602
- }] };
603
- } catch (error) {
604
- return { content: [{
605
- type: "text",
606
- text: JSON.stringify({
607
- success: false,
608
- message: "Failed to list XHR breakpoints",
609
- error: getErrorMessage$4(error)
610
- }, null, 2)
611
- }] };
612
- }
613
- }
614
- };
615
- //#endregion
616
- //#region src/server/domains/debugger/handlers/event-breakpoint.ts
617
- function hasEnsureAdvancedFeatures$1(manager) {
618
- return typeof manager.ensureAdvancedFeatures === "function";
619
- }
620
- function getErrorMessage$3(error) {
621
- if (typeof error === "object" && error !== null && "message" in error) {
622
- const message = error.message;
623
- if (typeof message === "string" && message.length > 0) return message;
624
- }
625
- return String(error);
626
- }
627
- var EventBreakpointHandlers = class {
628
- constructor(deps) {
629
- this.deps = deps;
630
- }
631
- async ensureAdvancedFeaturesIfSupported() {
632
- if (hasEnsureAdvancedFeatures$1(this.deps.debuggerManager)) await this.deps.debuggerManager.ensureAdvancedFeatures();
633
- }
634
- async handleEventBreakpointSet(args) {
635
- try {
636
- const eventName = argString(args, "eventName", "");
637
- const targetName = argString(args, "targetName");
638
- await this.ensureAdvancedFeaturesIfSupported();
639
- const breakpointId = await this.deps.debuggerManager.getEventManager().setEventListenerBreakpoint(eventName, targetName);
640
- return { content: [{
641
- type: "text",
642
- text: JSON.stringify({
643
- success: true,
644
- message: "Event breakpoint set",
645
- breakpointId,
646
- eventName,
647
- targetName
648
- }, null, 2)
649
- }] };
650
- } catch (error) {
651
- return { content: [{
652
- type: "text",
653
- text: JSON.stringify({
654
- success: false,
655
- message: "Failed to set event breakpoint",
656
- error: getErrorMessage$3(error)
657
- }, null, 2)
658
- }] };
659
- }
660
- }
661
- async handleEventBreakpointSetCategory(args) {
662
- try {
663
- const category = argString(args, "category", "");
664
- await this.ensureAdvancedFeaturesIfSupported();
665
- const eventManager = this.deps.debuggerManager.getEventManager();
666
- let breakpointIds;
667
- switch (category) {
668
- case "mouse":
669
- breakpointIds = await eventManager.setMouseEventBreakpoints();
670
- break;
671
- case "keyboard":
672
- breakpointIds = await eventManager.setKeyboardEventBreakpoints();
673
- break;
674
- case "timer":
675
- breakpointIds = await eventManager.setTimerEventBreakpoints();
676
- break;
677
- case "websocket":
678
- breakpointIds = await eventManager.setWebSocketEventBreakpoints();
679
- break;
680
- default: throw new Error(`Unknown category: ${category}`);
681
- }
682
- return { content: [{
683
- type: "text",
684
- text: JSON.stringify({
685
- success: true,
686
- message: `Set ${breakpointIds.length} ${category} event breakpoint(s)`,
687
- category,
688
- breakpointIds
689
- }, null, 2)
690
- }] };
691
- } catch (error) {
692
- return { content: [{
693
- type: "text",
694
- text: JSON.stringify({
695
- success: false,
696
- message: "Failed to set event breakpoints",
697
- error: getErrorMessage$3(error)
698
- }, null, 2)
699
- }] };
700
- }
701
- }
702
- async handleEventBreakpointRemove(args) {
703
- try {
704
- const breakpointId = argString(args, "breakpointId", "");
705
- await this.ensureAdvancedFeaturesIfSupported();
706
- const removed = await this.deps.debuggerManager.getEventManager().removeEventListenerBreakpoint(breakpointId);
707
- return { content: [{
708
- type: "text",
709
- text: JSON.stringify({
710
- success: removed,
711
- message: removed ? "Event breakpoint removed" : "Event breakpoint not found",
712
- breakpointId
713
- }, null, 2)
714
- }] };
715
- } catch (error) {
716
- return { content: [{
717
- type: "text",
718
- text: JSON.stringify({
719
- success: false,
720
- message: "Failed to remove event breakpoint",
721
- error: getErrorMessage$3(error)
722
- }, null, 2)
723
- }] };
724
- }
725
- }
726
- async handleEventBreakpointList(_args) {
727
- try {
728
- await this.ensureAdvancedFeaturesIfSupported();
729
- const breakpoints = this.deps.debuggerManager.getEventManager().getAllEventBreakpoints();
730
- return { content: [{
731
- type: "text",
732
- text: JSON.stringify({
733
- success: true,
734
- message: `Found ${breakpoints.length} event breakpoint(s)`,
735
- breakpoints
736
- }, null, 2)
737
- }] };
738
- } catch (error) {
739
- return { content: [{
740
- type: "text",
741
- text: JSON.stringify({
742
- success: false,
743
- message: "Failed to list event breakpoints",
744
- error: getErrorMessage$3(error)
745
- }, null, 2)
746
- }] };
747
- }
748
- }
749
- };
750
- //#endregion
751
- //#region src/server/domains/debugger/handlers/watch-expressions.ts
752
- function getErrorMessage$2(error) {
753
- if (typeof error === "object" && error !== null && "message" in error) {
754
- const message = error.message;
755
- if (typeof message === "string" && message.length > 0) return message;
756
- }
757
- return String(error);
758
- }
759
- var WatchExpressionsHandlers = class {
760
- constructor(deps) {
761
- this.deps = deps;
762
- }
763
- async handleWatchAdd(args) {
764
- try {
765
- const expression = argString(args, "expression", "");
766
- const name = argString(args, "name");
767
- const watchId = this.deps.debuggerManager.getWatchManager().addWatch(expression, name);
768
- return { content: [{
769
- type: "text",
770
- text: JSON.stringify({
771
- success: true,
772
- message: "Watch expression added",
773
- watchId,
774
- expression,
775
- name: name || expression
776
- }, null, 2)
777
- }] };
778
- } catch (error) {
779
- return { content: [{
780
- type: "text",
781
- text: JSON.stringify({
782
- success: false,
783
- message: "Failed to add watch expression",
784
- error: getErrorMessage$2(error)
785
- }, null, 2)
786
- }] };
787
- }
788
- }
789
- async handleWatchRemove(args) {
790
- try {
791
- const watchId = argString(args, "watchId", "");
792
- const removed = this.deps.debuggerManager.getWatchManager().removeWatch(watchId);
793
- return { content: [{
794
- type: "text",
795
- text: JSON.stringify({
796
- success: removed,
797
- message: removed ? "Watch expression removed" : "Watch expression not found",
798
- watchId
799
- }, null, 2)
800
- }] };
801
- } catch (error) {
802
- return { content: [{
803
- type: "text",
804
- text: JSON.stringify({
805
- success: false,
806
- message: "Failed to remove watch expression",
807
- error: getErrorMessage$2(error)
808
- }, null, 2)
809
- }] };
810
- }
811
- }
812
- async handleWatchList(_args) {
813
- try {
814
- const watches = this.deps.debuggerManager.getWatchManager().getAllWatches();
815
- return { content: [{
816
- type: "text",
817
- text: JSON.stringify({
818
- success: true,
819
- message: `Found ${watches.length} watch expression(s)`,
820
- watches
821
- }, null, 2)
822
- }] };
823
- } catch (error) {
824
- return { content: [{
825
- type: "text",
826
- text: JSON.stringify({
827
- success: false,
828
- message: "Failed to list watch expressions",
829
- error: getErrorMessage$2(error)
830
- }, null, 2)
831
- }] };
832
- }
833
- }
834
- async handleWatchEvaluateAll(args) {
835
- try {
836
- const callFrameId = argString(args, "callFrameId");
837
- const results = await this.deps.debuggerManager.getWatchManager().evaluateAll(callFrameId);
838
- return { content: [{
839
- type: "text",
840
- text: JSON.stringify({
841
- success: true,
842
- message: `Evaluated ${results.length} watch expression(s)`,
843
- results
844
- }, null, 2)
845
- }] };
846
- } catch (error) {
847
- return { content: [{
848
- type: "text",
849
- text: JSON.stringify({
850
- success: false,
851
- message: "Failed to evaluate watch expressions",
852
- error: getErrorMessage$2(error)
853
- }, null, 2)
854
- }] };
855
- }
856
- }
857
- async handleWatchClearAll(_args) {
858
- try {
859
- this.deps.debuggerManager.getWatchManager().clearAll();
860
- return { content: [{
861
- type: "text",
862
- text: JSON.stringify({
863
- success: true,
864
- message: "All watch expressions cleared"
865
- }, null, 2)
866
- }] };
867
- } catch (error) {
868
- return { content: [{
869
- type: "text",
870
- text: JSON.stringify({
871
- success: false,
872
- message: "Failed to clear watch expressions",
873
- error: getErrorMessage$2(error)
874
- }, null, 2)
875
- }] };
876
- }
877
- }
878
- };
879
- //#endregion
880
- //#region src/server/domains/debugger/handlers/scope-inspection.ts
881
- const getErrorMessage$1 = (error, fallback) => {
882
- if (error instanceof Error) return error.message;
883
- if (typeof error === "object" && error !== null && "message" in error) {
884
- const message = error.message;
885
- if (typeof message === "string") return message;
886
- }
887
- return fallback;
888
- };
889
- var ScopeInspectionHandlers = class {
890
- constructor(deps) {
891
- this.deps = deps;
892
- }
893
- async handleGetScopeVariablesEnhanced(args) {
894
- const callFrameId = argString(args, "callFrameId");
895
- const includeObjectProperties = argBool(args, "includeObjectProperties");
896
- const maxDepth = argNumber(args, "maxDepth");
897
- const skipErrors = argBool(args, "skipErrors", true);
898
- try {
899
- const result = await this.deps.debuggerManager.getScopeVariables({
900
- callFrameId,
901
- includeObjectProperties,
902
- maxDepth,
903
- skipErrors
904
- });
905
- return { content: [{
906
- type: "text",
907
- text: JSON.stringify(result, null, 2)
908
- }] };
909
- } catch (error) {
910
- return { content: [{
911
- type: "text",
912
- text: JSON.stringify({
913
- success: false,
914
- message: getErrorMessage$1(error, "Failed to get scope variables"),
915
- error: String(error)
916
- }, null, 2)
917
- }] };
918
- }
919
- }
920
- async handleGetObjectProperties(args) {
921
- const objectId = argString(args, "objectId", "");
922
- if (!objectId) return { content: [{
923
- type: "text",
924
- text: JSON.stringify({
925
- success: false,
926
- message: "objectId parameter is required"
927
- }, null, 2)
928
- }] };
929
- try {
930
- const properties = await this.deps.debuggerManager.getObjectPropertiesById(objectId);
931
- return { content: [{
932
- type: "text",
933
- text: JSON.stringify({
934
- success: true,
935
- propertyCount: properties.length,
936
- properties
937
- }, null, 2)
938
- }] };
939
- } catch (error) {
940
- return { content: [{
941
- type: "text",
942
- text: JSON.stringify({
943
- success: false,
944
- message: getErrorMessage$1(error, "Failed to get object properties"),
945
- error: String(error)
946
- }, null, 2)
947
- }] };
948
- }
949
- }
950
- };
951
- //#endregion
952
- //#region src/server/domains/debugger/handlers/blackbox-handlers.ts
953
- function hasEnsureAdvancedFeatures(manager) {
954
- return typeof manager.ensureAdvancedFeatures === "function";
955
- }
956
- function getErrorMessage(error) {
957
- if (typeof error === "object" && error !== null && "message" in error) {
958
- const message = error.message;
959
- if (typeof message === "string" && message.length > 0) return message;
960
- }
961
- return String(error);
962
- }
963
- var BlackboxHandlers = class {
964
- constructor(deps) {
965
- this.deps = deps;
966
- }
967
- async ensureAdvancedFeaturesIfSupported() {
968
- if (hasEnsureAdvancedFeatures(this.deps.debuggerManager)) await this.deps.debuggerManager.ensureAdvancedFeatures();
969
- }
970
- async getBlackboxManager() {
971
- await this.ensureAdvancedFeaturesIfSupported();
972
- return this.deps.debuggerManager.getBlackboxManager();
973
- }
974
- async handleBlackboxAdd(args) {
975
- try {
976
- const urlPattern = argString(args, "urlPattern", "");
977
- await (await this.getBlackboxManager()).blackboxByPattern(urlPattern);
978
- return { content: [{
979
- type: "text",
980
- text: JSON.stringify({
981
- success: true,
982
- message: "Script pattern blackboxed",
983
- urlPattern
984
- }, null, 2)
985
- }] };
986
- } catch (error) {
987
- return { content: [{
988
- type: "text",
989
- text: JSON.stringify({
990
- success: false,
991
- message: "Failed to add blackbox pattern",
992
- error: getErrorMessage(error)
993
- }, null, 2)
994
- }] };
995
- }
996
- }
997
- async handleBlackboxAddCommon(_args) {
998
- try {
999
- await (await this.getBlackboxManager()).blackboxCommonLibraries();
1000
- return { content: [{
1001
- type: "text",
1002
- text: JSON.stringify({
1003
- success: true,
1004
- message: "Blackboxed common library patterns"
1005
- }, null, 2)
1006
- }] };
1007
- } catch (error) {
1008
- return { content: [{
1009
- type: "text",
1010
- text: JSON.stringify({
1011
- success: false,
1012
- message: "Failed to add common blackbox patterns",
1013
- error: getErrorMessage(error)
1014
- }, null, 2)
1015
- }] };
1016
- }
1017
- }
1018
- async handleBlackboxList(_args) {
1019
- try {
1020
- const patterns = (await this.getBlackboxManager()).getAllBlackboxedPatterns();
1021
- return { content: [{
1022
- type: "text",
1023
- text: JSON.stringify({
1024
- success: true,
1025
- message: `Found ${patterns.length} blackboxed pattern(s)`,
1026
- patterns
1027
- }, null, 2)
1028
- }] };
1029
- } catch (error) {
1030
- return { content: [{
1031
- type: "text",
1032
- text: JSON.stringify({
1033
- success: false,
1034
- message: "Failed to list blackbox patterns",
1035
- error: getErrorMessage(error)
1036
- }, null, 2)
1037
- }] };
1038
- }
1039
- }
1040
- };
1041
- //#endregion
1042
- //#region src/server/domains/debugger/handlers.ts
1043
- var DebuggerToolHandlers = class {
1044
- debuggerManager;
1045
- runtimeInspector;
1046
- debuggerControl;
1047
- debuggerStepping;
1048
- debuggerEvaluate;
1049
- debuggerState;
1050
- sessionManagement;
1051
- breakpointBasic;
1052
- breakpointException;
1053
- xhrBreakpoint;
1054
- eventBreakpoint;
1055
- watchExpressions;
1056
- scopeInspection;
1057
- blackbox;
1058
- constructor(debuggerManager, runtimeInspector, eventBus) {
1059
- this.debuggerManager = debuggerManager;
1060
- this.runtimeInspector = runtimeInspector;
1061
- const commonDeps = {
1062
- debuggerManager: this.debuggerManager,
1063
- runtimeInspector: this.runtimeInspector
1064
- };
1065
- this.debuggerControl = new DebuggerControlHandlers(commonDeps);
1066
- this.debuggerStepping = new DebuggerSteppingHandlers({ debuggerManager: this.debuggerManager });
1067
- this.debuggerEvaluate = new DebuggerEvaluateHandlers({ runtimeInspector: this.runtimeInspector });
1068
- this.debuggerState = new DebuggerStateHandlers(commonDeps);
1069
- this.sessionManagement = new SessionManagementHandlers({ debuggerManager: this.debuggerManager });
1070
- this.breakpointBasic = new BreakpointBasicHandlers({
1071
- debuggerManager: this.debuggerManager,
1072
- eventBus
1073
- });
1074
- this.breakpointException = new BreakpointExceptionHandlers({ debuggerManager: this.debuggerManager });
1075
- this.xhrBreakpoint = new XHRBreakpointHandlers({ debuggerManager: this.debuggerManager });
1076
- this.eventBreakpoint = new EventBreakpointHandlers({ debuggerManager: this.debuggerManager });
1077
- this.watchExpressions = new WatchExpressionsHandlers({ debuggerManager: this.debuggerManager });
1078
- this.scopeInspection = new ScopeInspectionHandlers(commonDeps);
1079
- this.blackbox = new BlackboxHandlers({ debuggerManager: this.debuggerManager });
1080
- }
1081
- async handleDebuggerLifecycle(args) {
1082
- return this.debuggerControl.handleDebuggerLifecycle(args);
1083
- }
1084
- async handleDebuggerPause(args) {
1085
- return this.debuggerControl.handleDebuggerPause(args);
1086
- }
1087
- async handleDebuggerResume(args) {
1088
- return this.debuggerControl.handleDebuggerResume(args);
1089
- }
1090
- async handleDebuggerStepInto(args) {
1091
- return this.debuggerStepping.handleDebuggerStepInto(args);
1092
- }
1093
- async handleDebuggerStepOver(args) {
1094
- return this.debuggerStepping.handleDebuggerStepOver(args);
1095
- }
1096
- async handleDebuggerStepOut(args) {
1097
- return this.debuggerStepping.handleDebuggerStepOut(args);
1098
- }
1099
- async handleDebuggerEvaluate(args) {
1100
- return this.debuggerEvaluate.handleDebuggerEvaluate(args);
1101
- }
1102
- async handleDebuggerEvaluateGlobal(args) {
1103
- return this.debuggerEvaluate.handleDebuggerEvaluateGlobal(args);
1104
- }
1105
- async handleDebuggerWaitForPaused(args) {
1106
- return this.debuggerState.handleDebuggerWaitForPaused(args);
1107
- }
1108
- async handleDebuggerGetPausedState(args) {
1109
- return this.debuggerState.handleDebuggerGetPausedState(args);
1110
- }
1111
- async handleGetCallStack(args) {
1112
- return this.debuggerState.handleGetCallStack(args);
1113
- }
1114
- async handleSaveSession(args) {
1115
- return this.sessionManagement.handleSaveSession(args);
1116
- }
1117
- async handleLoadSession(args) {
1118
- return this.sessionManagement.handleLoadSession(args);
1119
- }
1120
- async handleExportSession(args) {
1121
- return this.sessionManagement.handleExportSession(args);
1122
- }
1123
- async handleListSessions(args) {
1124
- return this.sessionManagement.handleListSessions(args);
1125
- }
1126
- async handleBreakpointSet(args) {
1127
- return this.breakpointBasic.handleBreakpointSet(args);
1128
- }
1129
- async handleBreakpointRemove(args) {
1130
- return this.breakpointBasic.handleBreakpointRemove(args);
1131
- }
1132
- async handleBreakpointList(args) {
1133
- return this.breakpointBasic.handleBreakpointList(args);
1134
- }
1135
- async handleBreakpointSetOnException(args) {
1136
- return this.breakpointException.handleBreakpointSetOnException(args);
1137
- }
1138
- async handleXHRBreakpointSet(args) {
1139
- return this.xhrBreakpoint.handleXHRBreakpointSet(args);
1140
- }
1141
- async handleXHRBreakpointRemove(args) {
1142
- return this.xhrBreakpoint.handleXHRBreakpointRemove(args);
1143
- }
1144
- async handleXHRBreakpointList(args) {
1145
- return this.xhrBreakpoint.handleXHRBreakpointList(args);
1146
- }
1147
- async handleEventBreakpointSet(args) {
1148
- return this.eventBreakpoint.handleEventBreakpointSet(args);
1149
- }
1150
- async handleEventBreakpointSetCategory(args) {
1151
- return this.eventBreakpoint.handleEventBreakpointSetCategory(args);
1152
- }
1153
- async handleEventBreakpointRemove(args) {
1154
- return this.eventBreakpoint.handleEventBreakpointRemove(args);
1155
- }
1156
- async handleEventBreakpointList(args) {
1157
- return this.eventBreakpoint.handleEventBreakpointList(args);
1158
- }
1159
- async handleWatchAdd(args) {
1160
- return this.watchExpressions.handleWatchAdd(args);
1161
- }
1162
- async handleWatchRemove(args) {
1163
- return this.watchExpressions.handleWatchRemove(args);
1164
- }
1165
- async handleWatchList(args) {
1166
- return this.watchExpressions.handleWatchList(args);
1167
- }
1168
- async handleWatchEvaluateAll(args) {
1169
- return this.watchExpressions.handleWatchEvaluateAll(args);
1170
- }
1171
- async handleWatchClearAll(args) {
1172
- return this.watchExpressions.handleWatchClearAll(args);
1173
- }
1174
- async handleGetScopeVariablesEnhanced(args) {
1175
- return this.scopeInspection.handleGetScopeVariablesEnhanced(args);
1176
- }
1177
- async handleGetObjectProperties(args) {
1178
- return this.scopeInspection.handleGetObjectProperties(args);
1179
- }
1180
- async handleBlackboxAdd(args) {
1181
- return this.blackbox.handleBlackboxAdd(args);
1182
- }
1183
- async handleBlackboxAddCommon(args) {
1184
- return this.blackbox.handleBlackboxAddCommon(args);
1185
- }
1186
- async handleBlackboxList(args) {
1187
- return this.blackbox.handleBlackboxList(args);
1188
- }
1189
- /** breakpoint(action, type, ...) — unified breakpoint management */
1190
- async handleBreakpoint(args) {
1191
- const action = String(args["action"] ?? "");
1192
- const type = String(args["type"] ?? "code");
1193
- switch (type) {
1194
- case "code":
1195
- switch (action) {
1196
- case "set": return this.breakpointBasic.handleBreakpointSet(args);
1197
- case "remove": return this.breakpointBasic.handleBreakpointRemove(args);
1198
- case "list": return this.breakpointBasic.handleBreakpointList(args);
1199
- }
1200
- break;
1201
- case "xhr":
1202
- switch (action) {
1203
- case "set": return this.xhrBreakpoint.handleXHRBreakpointSet(args);
1204
- case "remove": return this.xhrBreakpoint.handleXHRBreakpointRemove(args);
1205
- case "list": return this.xhrBreakpoint.handleXHRBreakpointList(args);
1206
- }
1207
- break;
1208
- case "event":
1209
- switch (action) {
1210
- case "set": return this.eventBreakpoint.handleEventBreakpointSet(args);
1211
- case "remove": return this.eventBreakpoint.handleEventBreakpointRemove(args);
1212
- case "list": return this.eventBreakpoint.handleEventBreakpointList(args);
1213
- }
1214
- break;
1215
- case "event_category":
1216
- if (action === "set") return this.eventBreakpoint.handleEventBreakpointSetCategory(args);
1217
- break;
1218
- case "exception":
1219
- if (action === "set") return this.breakpointException.handleBreakpointSetOnException(args);
1220
- break;
1221
- }
1222
- return { content: [{
1223
- type: "text",
1224
- text: JSON.stringify({
1225
- success: false,
1226
- error: `Invalid breakpoint action/type: ${action}/${type}. Valid types: code, xhr, event, event_category, exception. Valid actions: set, remove, list.`
1227
- })
1228
- }] };
1229
- }
1230
- /** watch(action) — unified watch expression management */
1231
- async handleWatch(args) {
1232
- const action = String(args["action"] ?? "");
1233
- switch (action) {
1234
- case "add": return this.watchExpressions.handleWatchAdd(args);
1235
- case "remove": return this.watchExpressions.handleWatchRemove(args);
1236
- case "list": return this.watchExpressions.handleWatchList(args);
1237
- case "evaluate_all": return this.watchExpressions.handleWatchEvaluateAll(args);
1238
- case "clear_all": return this.watchExpressions.handleWatchClearAll(args);
1239
- default: return { content: [{
1240
- type: "text",
1241
- text: JSON.stringify({
1242
- success: false,
1243
- error: `Unknown watch action: ${action}. Valid: add, remove, list, evaluate_all, clear_all`
1244
- })
1245
- }] };
1246
- }
1247
- }
1248
- /** debugger_step(direction: 'into'|'over'|'out') */
1249
- async handleDebuggerStep(args) {
1250
- const direction = String(args["direction"] ?? "over");
1251
- switch (direction) {
1252
- case "into": return this.debuggerStepping.handleDebuggerStepInto(args);
1253
- case "over": return this.debuggerStepping.handleDebuggerStepOver(args);
1254
- case "out": return this.debuggerStepping.handleDebuggerStepOut(args);
1255
- default: return { content: [{
1256
- type: "text",
1257
- text: JSON.stringify({
1258
- success: false,
1259
- error: `Unknown direction: ${direction}. Valid: into, over, out`
1260
- })
1261
- }] };
1262
- }
1263
- }
1264
- /** debugger_evaluate(context: 'frame'|'global') */
1265
- async handleDebuggerEvaluateDispatch(args) {
1266
- if (String(args["context"] ?? "frame") === "global") return this.debuggerEvaluate.handleDebuggerEvaluateGlobal(args);
1267
- return this.debuggerEvaluate.handleDebuggerEvaluate(args);
1268
- }
1269
- /** debugger_session(action: 'save'|'load'|'export'|'list') */
1270
- async handleDebuggerSession(args) {
1271
- const action = String(args["action"] ?? "");
1272
- switch (action) {
1273
- case "save": return this.sessionManagement.handleSaveSession(args);
1274
- case "load": return this.sessionManagement.handleLoadSession(args);
1275
- case "export": return this.sessionManagement.handleExportSession(args);
1276
- case "list": return this.sessionManagement.handleListSessions(args);
1277
- default: return { content: [{
1278
- type: "text",
1279
- text: JSON.stringify({
1280
- success: false,
1281
- error: `Unknown action: ${action}. Valid actions: save, load, export, list`
1282
- })
1283
- }] };
1284
- }
1285
- }
1286
- };
1287
- //#endregion
1288
- export { DebuggerToolHandlers };