@jshookmcp/jshook 0.2.9 → 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 (316) 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-CtcdK78Q.mjs → HookGeneratorBuilders.core.generators.storage-Bf1fbrNK.mjs} +66 -174
  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-CqDTB_uk.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-Bl8zkwz1.mjs → handlers-pVNpaw4A.mjs} +144 -841
  102. package/dist/handlers.impl-CD2_kOcC.mjs +1 -0
  103. package/dist/hooks-DDKppogd.mjs +600 -0
  104. package/dist/index.mjs +12 -5225
  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 +12 -7
  169. package/dist/AntiCheatDetector-BNk-EoBt.mjs +0 -244
  170. package/dist/CacheAdapters-CDe5WPSV.mjs +0 -80
  171. package/dist/CodeInjector-Cq8q01kp.mjs +0 -150
  172. package/dist/ConsoleMonitor-CPVQW1Y-.mjs +0 -2201
  173. package/dist/DarwinAPI-BNPxu0RH.mjs +0 -363
  174. package/dist/DetailedDataManager-BQQcxh64.mjs +0 -217
  175. package/dist/EventBus-DgPmwpeu.mjs +0 -141
  176. package/dist/EvidenceGraphBridge-SFesNera.mjs +0 -153
  177. package/dist/ExtensionManager-CWYgw0YW.mjs +0 -714
  178. package/dist/FingerprintManager-gzWtkKuf.mjs +0 -96
  179. package/dist/HardwareBreakpoint-B9gZCdFP.mjs +0 -239
  180. package/dist/HeapAnalyzer-BLDH0dCv.mjs +0 -284
  181. package/dist/InstrumentationSession-CvPC7Jwy.mjs +0 -244
  182. package/dist/MemoryController-CbVdCIJF.mjs +0 -167
  183. package/dist/MemoryScanSession-BsDZbLYm.mjs +0 -278
  184. package/dist/MemoryScanner-Bcpml6II.mjs +0 -425
  185. package/dist/NativeMemoryManager.impl-dZtA1ZGn.mjs +0 -482
  186. package/dist/NativeMemoryManager.utils-B-FjA2mJ.mjs +0 -165
  187. package/dist/PEAnalyzer-D1lzJ_VG.mjs +0 -385
  188. package/dist/PageController-Bqm2kZ_X.mjs +0 -417
  189. package/dist/PointerChainEngine-BOhyVsjx.mjs +0 -322
  190. package/dist/PrerequisiteError-Dl33Svkz.mjs +0 -20
  191. package/dist/ResponseBuilder-D3iFYx2N.mjs +0 -143
  192. package/dist/ReverseEvidenceGraph-Dlsk94LC.mjs +0 -269
  193. package/dist/ScriptManager-aHHq0X7U.mjs +0 -3000
  194. package/dist/Speedhack-CqdIFlQl.mjs +0 -156
  195. package/dist/StealthVerifier-Bo4T3bz8.mjs +0 -135
  196. package/dist/StructureAnalyzer-DhFaPvRO.mjs +0 -426
  197. package/dist/ToolCatalog-C0JGZoOm.mjs +0 -582
  198. package/dist/ToolError-jh9whhMd.mjs +0 -15
  199. package/dist/ToolProbe-oC7aPrkv.mjs +0 -45
  200. package/dist/ToolRegistry-BjaF4oNz.mjs +0 -131
  201. package/dist/ToolRouter.policy-BWV67ZK-.mjs +0 -304
  202. package/dist/TraceRecorder-DgxyVbdQ.mjs +0 -519
  203. package/dist/VersionDetector-CwVLVdDM.mjs +0 -104
  204. package/dist/Win32API-CePkipZY.mjs +0 -340
  205. package/dist/Win32Debug-BvKs-gxc.mjs +0 -274
  206. package/dist/WorkflowEngine-CuvkZtWu.mjs +0 -598
  207. package/dist/analysis-CL9uACt9.mjs +0 -463
  208. package/dist/artifactRetention-CFEprwPw.mjs +0 -591
  209. package/dist/artifacts-Bk2-_uPq.mjs +0 -59
  210. package/dist/betterSqlite3-0pqusHHH.mjs +0 -74
  211. package/dist/binary-instrument-CXfpx6fT.mjs +0 -979
  212. package/dist/bind-helpers-xFfRF-qm.mjs +0 -22
  213. package/dist/boringssl-inspector-BH2D3VKc.mjs +0 -180
  214. package/dist/browser-BpOr5PEx.mjs +0 -4082
  215. package/dist/chunk-CjcI7cDX.mjs +0 -15
  216. package/dist/concurrency-Bt0yv1kJ.mjs +0 -41
  217. package/dist/constants-B0OANIBL.mjs +0 -519
  218. package/dist/coordination-qUbyF8KU.mjs +0 -259
  219. package/dist/debugger-gnKxRSN0.mjs +0 -1271
  220. package/dist/definitions-6M-eejaT.mjs +0 -53
  221. package/dist/definitions-B18eyf0B.mjs +0 -18
  222. package/dist/definitions-B3QdlrHv.mjs +0 -34
  223. package/dist/definitions-B4rAvHNZ.mjs +0 -63
  224. package/dist/definitions-BB_4jnmy.mjs +0 -37
  225. package/dist/definitions-BMfYXoNC.mjs +0 -43
  226. package/dist/definitions-Beid2EB3.mjs +0 -27
  227. package/dist/definitions-C1UvM5Iy.mjs +0 -126
  228. package/dist/definitions-CXEI7QC72.mjs +0 -216
  229. package/dist/definitions-C_4r7Fo-2.mjs +0 -14
  230. package/dist/definitions-CkFDALoa.mjs +0 -26
  231. package/dist/definitions-Cke7zEb8.mjs +0 -94
  232. package/dist/definitions-ClJLzsJQ.mjs +0 -25
  233. package/dist/definitions-Cq-zroAU.mjs +0 -28
  234. package/dist/definitions-Cy3Sl6gV.mjs +0 -34
  235. package/dist/definitions-D3VsGcvz.mjs +0 -47
  236. package/dist/definitions-DVGfrn7y.mjs +0 -96
  237. package/dist/definitions-LKpC3-nL.mjs +0 -9
  238. package/dist/definitions-bAhHQJq9.mjs +0 -359
  239. package/dist/encoding-Bvz5jLRv.mjs +0 -1065
  240. package/dist/evidence-graph-bridge-C_fv9PuC.mjs +0 -135
  241. package/dist/factory-DxlGh9Xf.mjs +0 -575
  242. package/dist/formatAddress-DVkj9kpI.mjs +0 -17
  243. package/dist/graphql-DYWzJ29s.mjs +0 -1026
  244. package/dist/handlers-9sAbfIg-.mjs +0 -2552
  245. package/dist/handlers-C67ktuRN.mjs +0 -710
  246. package/dist/handlers-C87g8oCe.mjs +0 -276
  247. package/dist/handlers-CTsDAO6p.mjs +0 -681
  248. package/dist/handlers-Cgyg6c0U.mjs +0 -645
  249. package/dist/handlers-D6j6yka7.mjs +0 -2124
  250. package/dist/handlers-DdFzXLvF.mjs +0 -446
  251. package/dist/handlers-DeLOCd5m.mjs +0 -799
  252. package/dist/handlers-DlCJN4Td.mjs +0 -757
  253. package/dist/handlers-DxGIq15_2.mjs +0 -917
  254. package/dist/handlers-U6L4xhuF.mjs +0 -585
  255. package/dist/handlers-tB9Mp9ZK.mjs +0 -84
  256. package/dist/handlers-tiy7EIBp.mjs +0 -572
  257. package/dist/handlers.impl-DS0d9fUw.mjs +0 -761
  258. package/dist/hooks-CzCWByww.mjs +0 -898
  259. package/dist/logger-Dh_xb7_2.mjs +0 -93
  260. package/dist/maintenance-P7ePRXQC.mjs +0 -830
  261. package/dist/manifest-2ToTpjv8.mjs +0 -106
  262. package/dist/manifest-3g71z6Bg.mjs +0 -79
  263. package/dist/manifest-82baTv4U.mjs +0 -45
  264. package/dist/manifest-B3QVVeBS.mjs +0 -82
  265. package/dist/manifest-BB2J8IMJ.mjs +0 -149
  266. package/dist/manifest-BKbgbSiY.mjs +0 -60
  267. package/dist/manifest-Bcf-TJzH.mjs +0 -848
  268. package/dist/manifest-BmtZzQiQ2.mjs +0 -45
  269. package/dist/manifest-Bnd7kqEY.mjs +0 -55
  270. package/dist/manifest-BqQX6OQC2.mjs +0 -65
  271. package/dist/manifest-BqrQ4Tpj.mjs +0 -81
  272. package/dist/manifest-Br4RPFt5.mjs +0 -370
  273. package/dist/manifest-C5qDjysN.mjs +0 -107
  274. package/dist/manifest-C9RT5nk32.mjs +0 -34
  275. package/dist/manifest-CAhOuvSl.mjs +0 -204
  276. package/dist/manifest-CBYWCUBJ.mjs +0 -51
  277. package/dist/manifest-CFADCRa1.mjs +0 -37
  278. package/dist/manifest-CQVhavRF.mjs +0 -114
  279. package/dist/manifest-CT7zZBV1.mjs +0 -48
  280. package/dist/manifest-CV12bcrF.mjs +0 -121
  281. package/dist/manifest-CXsRWjjI.mjs +0 -224
  282. package/dist/manifest-CZLUCfG02.mjs +0 -95
  283. package/dist/manifest-D6phHKFd.mjs +0 -131
  284. package/dist/manifest-DCyjf4n2.mjs +0 -294
  285. package/dist/manifest-DHsnKgP6.mjs +0 -60
  286. package/dist/manifest-Df_dliIe.mjs +0 -55
  287. package/dist/manifest-Dh8WBmEW.mjs +0 -129
  288. package/dist/manifest-DhKRAT8_.mjs +0 -92
  289. package/dist/manifest-DlpTj4ic2.mjs +0 -193
  290. package/dist/manifest-DrbmZcFl2.mjs +0 -253
  291. package/dist/manifest-DuwHjUa5.mjs +0 -70
  292. package/dist/manifest-DzwvxPJX.mjs +0 -38
  293. package/dist/manifest-NXctwWQq.mjs +0 -68
  294. package/dist/manifest-Sc_0JQ13.mjs +0 -418
  295. package/dist/manifest-gZ4s_UtG.mjs +0 -96
  296. package/dist/manifest-qSleDqdO.mjs +0 -1023
  297. package/dist/modules-C184v-S9.mjs +0 -11365
  298. package/dist/mojo-ipc-B_H61Afw.mjs +0 -525
  299. package/dist/network-671Cw6hV.mjs +0 -3346
  300. package/dist/outputPaths-B1uGmrWZ.mjs +0 -1145
  301. package/dist/parse-args-BlRjqlkL.mjs +0 -39
  302. package/dist/platform-WmNn8Sxb.mjs +0 -2070
  303. package/dist/process-QcbIy5Zq.mjs +0 -1401
  304. package/dist/proxy-DqNs0bAd.mjs +0 -170
  305. package/dist/registry-D-6e18lB.mjs +0 -34
  306. package/dist/response-BQVP-xUn.mjs +0 -28
  307. package/dist/shared-state-board-DV-dpHFJ.mjs +0 -586
  308. package/dist/sourcemap-Dq8ez8vS.mjs +0 -650
  309. package/dist/ssrf-policy-ZaUfvhq7.mjs +0 -166
  310. package/dist/streaming-BUQ0VJsg.mjs +0 -725
  311. package/dist/tool-builder-DCbIC5Eo.mjs +0 -186
  312. package/dist/transform-CiYJfNX0.mjs +0 -1007
  313. package/dist/types-Bx92KJfT.mjs +0 -4
  314. package/dist/types-CPhOReNX.mjs +0 -37
  315. package/dist/wasm-DQTnHDs4.mjs +0 -531
  316. package/dist/workflow-f3xJOcjx.mjs +0 -725
@@ -1,4 +0,0 @@
1
- //#region src/server/extensions/types.ts
2
- const INSTALLED_EXTENSION_METADATA_FILENAME = ".jshook-install.json";
3
- //#endregion
4
- export { INSTALLED_EXTENSION_METADATA_FILENAME as t };
@@ -1,37 +0,0 @@
1
- import { t as __exportAll } from "./chunk-CjcI7cDX.mjs";
2
- import { exec, execFile } from "child_process";
3
- import { promisify } from "util";
4
- //#region src/modules/process/memory/types.ts
5
- /**
6
- * Shared types and utility helpers for the memory sub-modules.
7
- */
8
- var types_exports = /* @__PURE__ */ __exportAll({
9
- execAsync: () => execAsync,
10
- execFileAsync: () => execFileAsync,
11
- executePowerShellScript: () => executePowerShellScript
12
- });
13
- const execAsync = promisify(exec);
14
- const execFileAsync = promisify(execFile);
15
- function getPowerShellExecutable() {
16
- return process.platform === "win32" ? "powershell.exe" : "powershell";
17
- }
18
- async function executePowerShellScript(script, options = {}) {
19
- const args = [
20
- "-NoProfile",
21
- "-ExecutionPolicy",
22
- "Bypass",
23
- "-EncodedCommand",
24
- Buffer.from(script, "utf16le").toString("base64")
25
- ];
26
- const { stdout, stderr } = await execFileAsync(getPowerShellExecutable(), args, {
27
- maxBuffer: options.maxBuffer ?? 1024 * 1024,
28
- timeout: options.timeout,
29
- windowsHide: true
30
- });
31
- return {
32
- stdout: String(stdout ?? ""),
33
- stderr: String(stderr ?? "")
34
- };
35
- }
36
- //#endregion
37
- export { types_exports as i, execFileAsync as n, executePowerShellScript as r, execAsync as t };
@@ -1,531 +0,0 @@
1
- import { mr as WASM_TOOL_TIMEOUT_MS, pr as WASM_OPTIMIZE_TIMEOUT_MS } from "./constants-B0OANIBL.mjs";
2
- import { o as ExternalToolRunner } from "./modules-C184v-S9.mjs";
3
- import { i as resolveArtifactPath } from "./artifacts-Bk2-_uPq.mjs";
4
- import { a as argString, o as argStringArray, r as argNumber, s as argStringRequired, t as argBool } from "./parse-args-BlRjqlkL.mjs";
5
- import { t as ToolRegistry } from "./ToolRegistry-BjaF4oNz.mjs";
6
- import "./definitions-Cy3Sl6gV.mjs";
7
- import { tmpdir } from "node:os";
8
- import { createHash } from "node:crypto";
9
- import { normalize, resolve, sep } from "node:path";
10
- import { stat, writeFile } from "node:fs/promises";
11
- //#region src/server/domains/wasm/handlers/shared.ts
12
- /**
13
- * Shared types and state for WASM sub-handlers.
14
- */
15
- const isRecord = (value) => typeof value === "object" && value !== null;
16
- const hasErrorResult = (value) => isRecord(value) && typeof value.error === "string";
17
- function validateOutputPath(outputPath) {
18
- const safe = resolve(outputPath);
19
- const cwd = normalize(process.cwd());
20
- const tmp = normalize(tmpdir());
21
- if (!safe.startsWith(`${cwd}${sep}`) && !safe.startsWith(`${tmp}${sep}`)) throw new Error("Path traversal blocked: outputPath must be under project root or temp directory");
22
- return safe;
23
- }
24
- //#endregion
25
- //#region src/server/domains/wasm/handlers/external-tool-handlers.ts
26
- /**
27
- * External tool sub-handler — disassemble, decompile, inspectSections, offlineRun, optimize.
28
- */
29
- var ExternalToolHandlers = class {
30
- state;
31
- constructor(state) {
32
- this.state = state;
33
- }
34
- async handleWasmDisassemble(args) {
35
- const inputPath = argStringRequired(args, "inputPath");
36
- const outputPath = argString(args, "outputPath");
37
- const foldExprs = argBool(args, "foldExprs", true);
38
- const toolArgs = [
39
- inputPath,
40
- "-o",
41
- "/dev/stdout"
42
- ];
43
- if (foldExprs) toolArgs.push("--fold-exprs");
44
- const result = await this.state.runner.run({
45
- tool: "wabt.wasm2wat",
46
- args: toolArgs,
47
- timeoutMs: WASM_TOOL_TIMEOUT_MS
48
- });
49
- if (!result.ok) return { content: [{
50
- type: "text",
51
- text: JSON.stringify({
52
- success: false,
53
- error: result.stderr,
54
- exitCode: result.exitCode
55
- })
56
- }] };
57
- let savedPath;
58
- if (outputPath) {
59
- const safePath = validateOutputPath(outputPath);
60
- await writeFile(safePath, result.stdout, "utf-8");
61
- savedPath = safePath;
62
- } else {
63
- const { absolutePath, displayPath } = await resolveArtifactPath({
64
- category: "wasm",
65
- toolName: "wasm-disassemble",
66
- ext: "wat"
67
- });
68
- await writeFile(absolutePath, result.stdout, "utf-8");
69
- savedPath = displayPath;
70
- }
71
- const lines = result.stdout.split("\n");
72
- const preview = lines.slice(0, 50).join("\n");
73
- return { content: [{
74
- type: "text",
75
- text: JSON.stringify({
76
- success: true,
77
- artifactPath: savedPath,
78
- totalLines: lines.length,
79
- sizeBytes: result.stdout.length,
80
- preview: preview + (lines.length > 50 ? "\n... (truncated)" : ""),
81
- durationMs: result.durationMs
82
- }, null, 2)
83
- }] };
84
- }
85
- async handleWasmDecompile(args) {
86
- const inputPath = argStringRequired(args, "inputPath");
87
- const outputPath = argString(args, "outputPath");
88
- const result = await this.state.runner.run({
89
- tool: "wabt.wasm-decompile",
90
- args: [
91
- inputPath,
92
- "-o",
93
- "/dev/stdout"
94
- ],
95
- timeoutMs: WASM_TOOL_TIMEOUT_MS
96
- });
97
- if (!result.ok) return { content: [{
98
- type: "text",
99
- text: JSON.stringify({
100
- success: false,
101
- error: result.stderr,
102
- exitCode: result.exitCode
103
- })
104
- }] };
105
- let savedPath;
106
- if (outputPath) {
107
- const safePath = validateOutputPath(outputPath);
108
- await writeFile(safePath, result.stdout, "utf-8");
109
- savedPath = safePath;
110
- } else {
111
- const { absolutePath, displayPath } = await resolveArtifactPath({
112
- category: "wasm",
113
- toolName: "wasm-decompile",
114
- ext: "dcmp"
115
- });
116
- await writeFile(absolutePath, result.stdout, "utf-8");
117
- savedPath = displayPath;
118
- }
119
- const lines = result.stdout.split("\n");
120
- const preview = lines.slice(0, 60).join("\n");
121
- return { content: [{
122
- type: "text",
123
- text: JSON.stringify({
124
- success: true,
125
- artifactPath: savedPath,
126
- totalLines: lines.length,
127
- preview: preview + (lines.length > 60 ? "\n... (truncated)" : ""),
128
- durationMs: result.durationMs
129
- }, null, 2)
130
- }] };
131
- }
132
- async handleWasmInspectSections(args) {
133
- const inputPath = argStringRequired(args, "inputPath");
134
- const flags = ({
135
- headers: "-h",
136
- details: "-x",
137
- disassemble: "-d",
138
- all: "-h -x -d"
139
- }[argString(args, "sections", "details")] || "-x").split(" ");
140
- const result = await this.state.runner.run({
141
- tool: "wabt.wasm-objdump",
142
- args: [...flags, inputPath],
143
- timeoutMs: WASM_TOOL_TIMEOUT_MS
144
- });
145
- if (!result.ok) return { content: [{
146
- type: "text",
147
- text: JSON.stringify({
148
- success: false,
149
- error: result.stderr,
150
- exitCode: result.exitCode
151
- })
152
- }] };
153
- const lines = result.stdout.split("\n");
154
- const preview = lines.slice(0, 100).join("\n");
155
- return { content: [{
156
- type: "text",
157
- text: JSON.stringify({
158
- success: true,
159
- totalLines: lines.length,
160
- preview: preview + (lines.length > 100 ? "\n... (truncated)" : ""),
161
- durationMs: result.durationMs
162
- }, null, 2)
163
- }] };
164
- }
165
- async handleWasmOfflineRun(args) {
166
- const inputPath = argStringRequired(args, "inputPath");
167
- const functionName = argStringRequired(args, "functionName");
168
- const fnArgs = argStringArray(args, "args");
169
- const runtime = argString(args, "runtime", "auto");
170
- const timeoutMs = argNumber(args, "timeoutMs", 1e4);
171
- let toolName;
172
- if (runtime === "auto") {
173
- const probes = await this.state.runner.probeAll();
174
- if (probes["runtime.wasmtime"]?.available) toolName = "runtime.wasmtime";
175
- else if (probes["runtime.wasmer"]?.available) toolName = "runtime.wasmer";
176
- else return { content: [{
177
- type: "text",
178
- text: JSON.stringify({
179
- success: false,
180
- error: "No WASM runtime found. Install wasmtime or wasmer."
181
- })
182
- }] };
183
- } else toolName = runtime === "wasmer" ? "runtime.wasmer" : "runtime.wasmtime";
184
- const runArgs = toolName === "runtime.wasmtime" ? [
185
- "run",
186
- "--invoke",
187
- functionName,
188
- inputPath,
189
- ...fnArgs
190
- ] : [
191
- "run",
192
- inputPath,
193
- "--invoke",
194
- functionName,
195
- "--",
196
- ...fnArgs
197
- ];
198
- const result = await this.state.runner.run({
199
- tool: toolName,
200
- args: runArgs,
201
- timeoutMs
202
- });
203
- return { content: [{
204
- type: "text",
205
- text: JSON.stringify({
206
- success: result.ok,
207
- runtime: toolName,
208
- functionName,
209
- args: fnArgs,
210
- output: result.stdout.trim(),
211
- stderr: result.stderr.trim() || void 0,
212
- exitCode: result.exitCode,
213
- durationMs: result.durationMs
214
- }, null, 2)
215
- }] };
216
- }
217
- async handleWasmOptimize(args) {
218
- const inputPath = argStringRequired(args, "inputPath");
219
- const outputPath = argString(args, "outputPath");
220
- const level = argString(args, "level", "O2");
221
- let destPath;
222
- if (outputPath) destPath = validateOutputPath(outputPath);
223
- else {
224
- const { absolutePath } = await resolveArtifactPath({
225
- category: "wasm",
226
- toolName: "wasm-opt",
227
- ext: "wasm"
228
- });
229
- destPath = absolutePath;
230
- }
231
- const result = await this.state.runner.run({
232
- tool: "binaryen.wasm-opt",
233
- args: [
234
- `-${level}`,
235
- inputPath,
236
- "-o",
237
- destPath
238
- ],
239
- timeoutMs: WASM_OPTIMIZE_TIMEOUT_MS
240
- });
241
- if (!result.ok) return { content: [{
242
- type: "text",
243
- text: JSON.stringify({
244
- success: false,
245
- error: result.stderr,
246
- exitCode: result.exitCode
247
- })
248
- }] };
249
- let inputSize = 0;
250
- let outputSize = 0;
251
- try {
252
- inputSize = (await stat(inputPath)).size;
253
- outputSize = (await stat(destPath)).size;
254
- } catch {}
255
- return { content: [{
256
- type: "text",
257
- text: JSON.stringify({
258
- success: true,
259
- artifactPath: destPath,
260
- optimizationLevel: level,
261
- inputSizeBytes: inputSize,
262
- outputSizeBytes: outputSize,
263
- reductionPercent: inputSize > 0 ? ((1 - outputSize / inputSize) * 100).toFixed(1) : "0",
264
- durationMs: result.durationMs
265
- }, null, 2)
266
- }] };
267
- }
268
- };
269
- //#endregion
270
- //#region src/server/domains/wasm/handlers/browser-handlers.ts
271
- /**
272
- * Browser sub-handler — dump, vmpTrace, memoryInspect.
273
- */
274
- var BrowserHandlers = class {
275
- state;
276
- constructor(state) {
277
- this.state = state;
278
- }
279
- async handleWasmDump(args) {
280
- const moduleIndex = argNumber(args, "moduleIndex", 0);
281
- const outputPath = argString(args, "outputPath");
282
- const page = await this.state.collector.getActivePage();
283
- const result = await page.evaluate((idx) => {
284
- const hooksRaw = window.__aiHooks?.["preset-webassembly-full"];
285
- if (!Array.isArray(hooksRaw) || hooksRaw.length === 0) return { error: "No WASM modules captured. Ensure the webassembly-full hook preset is active and the page has loaded WASM." };
286
- const instantiatedEvents = hooksRaw.filter((e) => e.type === "instantiated");
287
- if (idx >= instantiatedEvents.length) return { error: `Module index ${idx} out of range. Found ${instantiatedEvents.length} instantiated modules.` };
288
- const event = instantiatedEvents[idx];
289
- return {
290
- exports: event.exports,
291
- importMods: event.importMods,
292
- size: event.size,
293
- moduleCount: instantiatedEvents.length
294
- };
295
- }, moduleIndex);
296
- if (hasErrorResult(result)) return { content: [{
297
- type: "text",
298
- text: JSON.stringify({
299
- success: false,
300
- error: result.error
301
- })
302
- }] };
303
- const wasmBytes = await page.evaluate((idx) => {
304
- const storage = window.__wasmModuleStorage;
305
- if (!storage?.[idx]) return null;
306
- const buffer = storage[idx];
307
- return Array.from(new Uint8Array(buffer));
308
- }, moduleIndex);
309
- let savedPath;
310
- let hash;
311
- if (wasmBytes) {
312
- const buffer = Buffer.from(wasmBytes);
313
- hash = createHash("sha256").update(buffer).digest("hex").substring(0, 16);
314
- if (outputPath) {
315
- const safePath = validateOutputPath(outputPath);
316
- await writeFile(safePath, buffer);
317
- savedPath = safePath;
318
- } else {
319
- const { absolutePath, displayPath } = await resolveArtifactPath({
320
- category: "wasm",
321
- toolName: "wasm-dump",
322
- target: hash,
323
- ext: "wasm"
324
- });
325
- await writeFile(absolutePath, buffer);
326
- savedPath = displayPath;
327
- }
328
- } else savedPath = "(binary not available — hook did not store raw bytes)";
329
- return { content: [{
330
- type: "text",
331
- text: JSON.stringify({
332
- success: true,
333
- artifactPath: savedPath,
334
- hash,
335
- size: result.size,
336
- exports: result.exports,
337
- importModules: result.importMods,
338
- totalModules: result.moduleCount,
339
- hint: wasmBytes ? "Use wasm_disassemble or wasm_decompile on the dumped file for further analysis." : "Binary not captured. Inject hook_preset(\"webassembly-full\") BEFORE page navigation, with window.__wasmModuleStorage patching."
340
- }, null, 2)
341
- }] };
342
- }
343
- async handleWasmVmpTrace(args) {
344
- const maxEvents = argNumber(args, "maxEvents", 5e3);
345
- const filterModule = argString(args, "filterModule");
346
- const traceData = await (await this.state.collector.getActivePage()).evaluate((opts) => {
347
- const hooksRaw = window.__aiHooks?.["preset-webassembly-full"];
348
- if (!Array.isArray(hooksRaw) || hooksRaw.length === 0) return { error: "No WASM hook data. Inject hook_preset(\"webassembly-full\") and reload the page." };
349
- let importCalls = hooksRaw.filter((e) => e.type === "import_call");
350
- if (opts.filterModule) importCalls = importCalls.filter((e) => e.mod === opts.filterModule);
351
- const limited = importCalls.slice(0, opts.maxEvents);
352
- const fnCounts = {};
353
- for (const call of limited) {
354
- const key = `${String(call.mod)}.${String(call.fn)}`;
355
- fnCounts[key] = (fnCounts[key] || 0) + 1;
356
- }
357
- const sorted = Object.entries(fnCounts).toSorted((a, b) => b[1] - a[1]).slice(0, 30).map(([name, count]) => ({
358
- name,
359
- count
360
- }));
361
- return {
362
- totalEvents: importCalls.length,
363
- capturedEvents: limited.length,
364
- topFunctions: sorted,
365
- trace: limited.slice(0, 200).map((e) => ({
366
- mod: e.mod,
367
- fn: e.fn,
368
- args: e.args,
369
- ts: e.ts
370
- }))
371
- };
372
- }, {
373
- maxEvents,
374
- filterModule
375
- });
376
- if (hasErrorResult(traceData)) return { content: [{
377
- type: "text",
378
- text: JSON.stringify({
379
- success: false,
380
- error: traceData.error
381
- })
382
- }] };
383
- return { content: [{
384
- type: "text",
385
- text: JSON.stringify({
386
- success: true,
387
- ...traceData,
388
- hint: "Top functions show VMP handler dispatch patterns. Use wasm_disassemble to analyze their implementation."
389
- }, null, 2)
390
- }] };
391
- }
392
- async handleWasmMemoryInspect(args) {
393
- const offset = argNumber(args, "offset", 0);
394
- const length = Math.min(argNumber(args, "length", 256), 65536);
395
- const format = argString(args, "format", "both");
396
- const searchPattern = argString(args, "searchPattern");
397
- const memData = await (await this.state.collector.getActivePage()).evaluate((opts) => {
398
- const win = window;
399
- const hooksRaw = win.__aiHooks?.["preset-webassembly-full"];
400
- const memoryEvents = (Array.isArray(hooksRaw) ? hooksRaw : []).filter((e) => e.type === "memory_created");
401
- const instances = win.__wasmInstances;
402
- if (!Array.isArray(instances) || instances.length === 0) return { error: "No WASM memory available. Ensure the webassembly-full hook is active and a WASM module is instantiated." };
403
- try {
404
- const memory = instances[0].exports?.memory;
405
- if (!memory?.buffer) return { error: "WASM module has no exported memory." };
406
- const buffer = new Uint8Array(memory.buffer);
407
- const slice = Array.from(buffer.slice(opts.offset, opts.offset + opts.length));
408
- let searchResults;
409
- if (opts.searchPattern) {
410
- searchResults = [];
411
- const pattern = opts.searchPattern;
412
- if (/^[0-9a-fA-F\s]+$/.test(pattern)) {
413
- const hexBytes = pattern.replace(/\s/g, "").match(/.{2}/g)?.map((h) => parseInt(h, 16)) || [];
414
- for (let i = opts.offset; i <= Math.min(opts.offset + opts.length - hexBytes.length, buffer.length - hexBytes.length); i++) {
415
- let match = true;
416
- for (let j = 0; j < hexBytes.length; j++) if (buffer[i + j] !== hexBytes[j]) {
417
- match = false;
418
- break;
419
- }
420
- if (match) searchResults.push({ offset: i });
421
- }
422
- } else {
423
- const patternBytes = new TextEncoder().encode(pattern);
424
- for (let i = opts.offset; i <= Math.min(opts.offset + opts.length - patternBytes.length, buffer.length - patternBytes.length); i++) {
425
- let match = true;
426
- for (let j = 0; j < patternBytes.length; j++) if (buffer[i + j] !== patternBytes[j]) {
427
- match = false;
428
- break;
429
- }
430
- if (match) searchResults.push({ offset: i });
431
- }
432
- }
433
- }
434
- return {
435
- totalMemoryPages: memory.buffer.byteLength / 65536,
436
- totalMemoryBytes: memory.buffer.byteLength,
437
- requestedOffset: opts.offset,
438
- requestedLength: opts.length,
439
- data: slice,
440
- searchResults,
441
- memoryInfo: memoryEvents[0] || null
442
- };
443
- } catch (e) {
444
- return { error: `Failed to read WASM memory: ${e instanceof Error ? e.message : String(e)}` };
445
- }
446
- }, {
447
- offset,
448
- length,
449
- searchPattern
450
- });
451
- if (hasErrorResult(memData)) return { content: [{
452
- type: "text",
453
- text: JSON.stringify({
454
- success: false,
455
- error: memData.error
456
- })
457
- }] };
458
- const data = memData.data;
459
- let hexDump = "";
460
- let asciiDump = "";
461
- if (format === "hex" || format === "both") for (let i = 0; i < data.length; i += 16) {
462
- const row = data.slice(i, i + 16);
463
- const addr = (offset + i).toString(16).padStart(8, "0");
464
- const hex = row.map((b) => b.toString(16).padStart(2, "0")).join(" ");
465
- const ascii = row.map((b) => b >= 32 && b < 127 ? String.fromCharCode(b) : ".").join("");
466
- hexDump += `${addr} ${hex.padEnd(48)} |${ascii}|\n`;
467
- }
468
- if (format === "ascii") asciiDump = data.map((b) => b >= 32 && b < 127 ? String.fromCharCode(b) : ".").join("");
469
- return { content: [{
470
- type: "text",
471
- text: JSON.stringify({
472
- success: true,
473
- totalMemoryPages: memData.totalMemoryPages,
474
- totalMemoryBytes: memData.totalMemoryBytes,
475
- offset,
476
- length: data.length,
477
- hexDump: format !== "ascii" ? hexDump : void 0,
478
- asciiDump: format === "ascii" ? asciiDump : void 0,
479
- searchResults: memData.searchResults
480
- }, null, 2)
481
- }] };
482
- }
483
- };
484
- //#endregion
485
- //#region src/server/domains/wasm/handlers.impl.core.ts
486
- /**
487
- * WASM domain — composition facade.
488
- *
489
- * External tool operations in ./handlers/external-tool-handlers.ts.
490
- * Browser operations in ./handlers/browser-handlers.ts.
491
- */
492
- var WasmToolHandlers = class {
493
- state;
494
- externalTools;
495
- browser;
496
- constructor(collector) {
497
- const runner = new ExternalToolRunner(new ToolRegistry());
498
- this.state = {
499
- collector,
500
- runner
501
- };
502
- this.externalTools = new ExternalToolHandlers(this.state);
503
- this.browser = new BrowserHandlers(this.state);
504
- }
505
- handleWasmDump(args) {
506
- return this.browser.handleWasmDump(args);
507
- }
508
- handleWasmDisassemble(args) {
509
- return this.externalTools.handleWasmDisassemble(args);
510
- }
511
- handleWasmDecompile(args) {
512
- return this.externalTools.handleWasmDecompile(args);
513
- }
514
- handleWasmInspectSections(args) {
515
- return this.externalTools.handleWasmInspectSections(args);
516
- }
517
- handleWasmOfflineRun(args) {
518
- return this.externalTools.handleWasmOfflineRun(args);
519
- }
520
- handleWasmOptimize(args) {
521
- return this.externalTools.handleWasmOptimize(args);
522
- }
523
- handleWasmVmpTrace(args) {
524
- return this.browser.handleWasmVmpTrace(args);
525
- }
526
- handleWasmMemoryInspect(args) {
527
- return this.browser.handleWasmMemoryInspect(args);
528
- }
529
- };
530
- //#endregion
531
- export { WasmToolHandlers };