@jshookmcp/jshook 0.3.2 → 0.3.4

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 (357) hide show
  1. package/README.md +19 -4
  2. package/README.zh.md +19 -4
  3. package/dist/AntiCheatDetector-B-mz4DK_.mjs +1 -0
  4. package/dist/{BrowserSessionCoordinator-BJ-HOxo0.mjs → BrowserSessionCoordinator-Cdic8FsH.mjs} +1 -1
  5. package/dist/CodeAnalyzerDataFlow-a-NkwcaG.mjs +2 -0
  6. package/dist/CodeInjector-B099WO6x.mjs +1 -0
  7. package/dist/ConsoleMonitor-BZRqrBH-.mjs +306 -0
  8. package/dist/CpuEngine-BC8jayy9.mjs +1 -0
  9. package/dist/DartAotExecutor-B7WVTKsd.mjs +1 -0
  10. package/dist/DartAotLoader-BxdhW-K2.mjs +2 -0
  11. package/dist/DarwinAPI-DzojdfjF.mjs +1 -0
  12. package/dist/DetailedDataManager-Dgh402Gp.mjs +5 -0
  13. package/dist/ExecutionSandbox-QbWQmzuC.mjs +45 -0
  14. package/dist/ExtensionManager.tools-D3h818Xs.mjs +1 -0
  15. package/dist/FingerprintManager-D9Zlr6be.mjs +1 -0
  16. package/dist/HardwareBreakpoint-C_lJ22bj.mjs +1 -0
  17. package/dist/HeapAnalyzer-bJbLvzp6.mjs +1 -0
  18. package/dist/HookPatternScanner-yx4vJ9sd.mjs +1 -0
  19. package/dist/InstrumentationSession-Cv1wikLA.mjs +1 -0
  20. package/dist/IntegrityScanner-BB7sw-SA.mjs +1 -0
  21. package/dist/JScramblerDeobfuscator-NVR5VatT.mjs +1 -0
  22. package/dist/MCPServer.activation.ttl-C2wOCMLV.mjs +1 -0
  23. package/dist/MCPServer.search.helpers-DlassAew.mjs +2 -0
  24. package/dist/MCPServer.search.validation-DnifPCCv.mjs +1 -0
  25. package/dist/MemoryController-CCsGuGJS.mjs +2 -0
  26. package/dist/{MemoryScanSession-DG_F-PjE.mjs → MemoryScanSession-BZ2A9Ph1.mjs} +1 -1
  27. package/dist/MemoryScanner-DAxsq7Sx.mjs +1 -0
  28. package/dist/NativeMemoryManager.impl-BIJzXMqH.mjs +1 -0
  29. package/dist/{NativeMemoryManager.utils-BHy1P_jM.mjs → NativeMemoryManager.utils-CMoul2an.mjs} +1 -1
  30. package/dist/PEAnalyzer-CB_kaTis.mjs +1 -0
  31. package/dist/PackerDeobfuscator-BpwGjxDL.mjs +7 -0
  32. package/dist/PointerChainEngine-B6SYv6ZM.mjs +1 -0
  33. package/dist/ProcessRegistry-C5W1Tkn9.mjs +1 -0
  34. package/dist/{handlers-mPFiNPe8.mjs → QuickJSSandbox-CIde-jzG.mjs} +2 -5
  35. package/dist/{ResponseBuilder-BfWP-uaT.mjs → ResponseBuilder-BLicSCjn.mjs} +1 -1
  36. package/dist/ReverseEvidenceGraph-DJzk0GQz.mjs +2 -0
  37. package/dist/ServerRuntimeState-DGXNv8Ji.mjs +1 -0
  38. package/dist/Speedhack-MGoeq1ZS.mjs +1 -0
  39. package/dist/StructureAnalyzer-CCTWAXR3.mjs +2 -0
  40. package/dist/ToolHandlerMap-C40EmuLT.mjs +1 -0
  41. package/dist/{ToolProbe-C7ZU2x7M.mjs → ToolProbe-B02GC3ZY.mjs} +1 -1
  42. package/dist/ToolRegistry-CzqQxFqf.mjs +1 -0
  43. package/dist/ToolRouter.policy-Bgb3S8jc.mjs +4 -0
  44. package/dist/TraceRecorder-BfeCTQUj.mjs +407 -0
  45. package/dist/VMDeobfuscator-BHtkV850.mjs +1 -0
  46. package/dist/Win32API-G7QPyckq.mjs +1 -0
  47. package/dist/{Win32Debug-CYrIQBvr.mjs → Win32Debug-6yzmtv5b.mjs} +1 -1
  48. package/dist/allocation-track-CiI-CnaI.mjs +1 -0
  49. package/dist/analysis-CojUzwX-.mjs +27 -0
  50. package/dist/antidebug-CgU84TE1.mjs +1 -0
  51. package/dist/apk-DrPBsOq8.mjs +1 -0
  52. package/dist/artifactRetention-Bk6fW2uF.mjs +1 -0
  53. package/dist/artifacts-Bx9GLx4J.mjs +1 -0
  54. package/dist/ast-bridge-BlOrmVAv.mjs +1 -0
  55. package/dist/ast-utils-B9E5k_v1.mjs +1 -0
  56. package/dist/{betterSqlite3-Brtq-SIQ.mjs → betterSqlite3-Bdo_ifuJ.mjs} +1 -1
  57. package/dist/binary-instrument-DiE1BP0x.mjs +12 -0
  58. package/dist/boringssl-inspector-C6M3sOga.mjs +2 -0
  59. package/dist/browser-QDUu5ML9.mjs +29 -0
  60. package/dist/{handlers-yo_xYzT8.mjs → canvas-g5kmLdY-.mjs} +1098 -24
  61. package/dist/{capabilities-CyXuKUl1.mjs → capabilities-DwzyxL2w.mjs} +1 -1
  62. package/dist/cdp-session-Dy4OwMOP.mjs +1 -0
  63. package/dist/collector-Cld4i-E4.mjs +1 -0
  64. package/dist/config-5ODJ3Aj0.mjs +3 -0
  65. package/dist/constants-nvsLpSri.mjs +1 -0
  66. package/dist/coordination-C6y2gM9O.mjs +98 -0
  67. package/dist/coverage-and-block--cWjjEe5.mjs +1 -0
  68. package/dist/dart-inspector-D4IKxZ6u.mjs +0 -0
  69. package/dist/debugger-C2SpiXoO.mjs +1 -0
  70. package/dist/definitions-0mtilYzG.mjs +1 -0
  71. package/dist/definitions-9csunmeX.mjs +1 -0
  72. package/dist/definitions-B11MudW_.mjs +1 -0
  73. package/dist/definitions-BKpRDjcI.mjs +1 -0
  74. package/dist/definitions-BXE3H4re.mjs +1 -0
  75. package/dist/definitions-BlPHe5DX.mjs +1 -0
  76. package/dist/definitions-Bob4XMxI.mjs +27 -0
  77. package/dist/definitions-BpIQN2nm.mjs +1 -0
  78. package/dist/definitions-BvolWeSu.mjs +1 -0
  79. package/dist/definitions-C-6j3Ejl.mjs +1 -0
  80. package/dist/definitions-C-AdFfFu.mjs +1 -0
  81. package/dist/definitions-CArdw_9T.mjs +1 -0
  82. package/dist/definitions-CCvIcRrT.mjs +1 -0
  83. package/dist/definitions-CJPE5PIl.mjs +1 -0
  84. package/dist/definitions-CbqeW06u.mjs +1 -0
  85. package/dist/definitions-Cexmkypg.mjs +1 -0
  86. package/dist/definitions-D1dxl8qt.mjs +1 -0
  87. package/dist/definitions-D3uT-ZbU.mjs +1 -0
  88. package/dist/definitions-DtOY5iUc.mjs +1 -0
  89. package/dist/{definitions-DxFNRQNK2.mjs → definitions-DvrYdDCJ2.mjs} +1 -1
  90. package/dist/{definitions-Cenu6mxo.mjs → definitions-aeRd5DAR.mjs} +1 -1
  91. package/dist/definitions-ihxOqOC4.mjs +1 -0
  92. package/dist/deopt-trace-qnAcC931.mjs +17 -0
  93. package/dist/disasm-DoxSucGp.mjs +1 -0
  94. package/dist/dumpsys-parser-Du-5ruEe.mjs +2 -0
  95. package/dist/encoding-UMtwgy4M.mjs +2 -0
  96. package/dist/ensure-browser-core-BP70x0TB.mjs +285 -0
  97. package/dist/factory-BeND77hf.mjs +2 -0
  98. package/dist/graphql-CF7QKJME.mjs +68 -0
  99. package/dist/grpc-raw-Dp7ps2sv.mjs +1 -0
  100. package/dist/handlers--qCl9vNv.mjs +1 -0
  101. package/dist/handlers-BHIu1LqA.mjs +1 -0
  102. package/dist/{antidebug-7L3ygj_9.mjs → handlers-BQ4K8Jbr.mjs} +2 -2
  103. package/dist/handlers-BxQv-wtf.mjs +8 -0
  104. package/dist/handlers-ByYG27-5.mjs +1 -0
  105. package/dist/handlers-C0I9-BtX.mjs +5 -0
  106. package/dist/handlers-CL0Iokmw.mjs +1 -0
  107. package/dist/handlers-CNbhIdSK.mjs +4 -0
  108. package/dist/handlers-CnTTSJFs.mjs +109 -0
  109. package/dist/handlers-CoDx6akJ2.mjs +49 -0
  110. package/dist/{handlers-0yKLRIfo.mjs → handlers-DASJI0Pn.mjs} +1 -1
  111. package/dist/handlers-DRKMaA-_.mjs +74 -0
  112. package/dist/handlers-Dalu0olz.mjs +2 -0
  113. package/dist/handlers-KY0g31ny.mjs +9 -0
  114. package/dist/handlers-oGo60aVv.mjs +1 -0
  115. package/dist/handlers.impl-BTXLw6Qc.mjs +1 -0
  116. package/dist/heap-sampling-BqdiU-5j.mjs +1 -0
  117. package/dist/{hooks-D4XLfgtV.mjs → hooks-COK3t5rT.mjs} +52 -33
  118. package/dist/index.mjs +11 -11
  119. package/dist/logger-BGCcd-jJ.mjs +1 -0
  120. package/dist/macro-nUYUjKNZ.mjs +2 -0
  121. package/dist/maintenance-CfnE7ZKU.mjs +4 -0
  122. package/dist/manifest-7EOTUc0D.mjs +1 -0
  123. package/dist/manifest-B5ujuQmf.mjs +1 -0
  124. package/dist/manifest-BErXl3zn.mjs +1 -0
  125. package/dist/manifest-BKA-mD3J.mjs +1 -0
  126. package/dist/manifest-BUXj23bX.mjs +1 -0
  127. package/dist/manifest-BfXt9cau.mjs +1 -0
  128. package/dist/manifest-Bx-tpURK.mjs +1 -0
  129. package/dist/manifest-C0owVAdq.mjs +1 -0
  130. package/dist/manifest-C5XqYc9o.mjs +1 -0
  131. package/dist/manifest-CVKzLjsA.mjs +1 -0
  132. package/dist/manifest-CaeFjdhj.mjs +1 -0
  133. package/dist/manifest-CegBgip0.mjs +1 -0
  134. package/dist/manifest-CoJHqlgS.mjs +1 -0
  135. package/dist/manifest-D0dbtDqd.mjs +1 -0
  136. package/dist/manifest-D5Gr8ujd.mjs +12 -0
  137. package/dist/manifest-D82z-5og.mjs +1 -0
  138. package/dist/manifest-DA2afIwh.mjs +1 -0
  139. package/dist/manifest-DAbiFP5o.mjs +1 -0
  140. package/dist/manifest-DEY0s1O72.mjs +1 -0
  141. package/dist/manifest-DTOqNqiA.mjs +1 -0
  142. package/dist/manifest-DZ6ELNgX.mjs +1 -0
  143. package/dist/manifest-DjHkjddT.mjs +1 -0
  144. package/dist/manifest-DocA_itf2.mjs +1 -0
  145. package/dist/manifest-Dpnhvfq0.mjs +1 -0
  146. package/dist/manifest-DucPMG_a.mjs +1 -0
  147. package/dist/manifest-Dw5yYEac.mjs +1 -0
  148. package/dist/manifest-Ic_Cg66S.mjs +1 -0
  149. package/dist/manifest-JHaG6GMN.mjs +1 -0
  150. package/dist/manifest-QdkIzmYM.mjs +1 -0
  151. package/dist/manifest-YZqaCe25.mjs +1 -0
  152. package/dist/manifest-f0lUeXwq.mjs +1 -0
  153. package/dist/manifest-h-Ebisf8.mjs +1 -0
  154. package/dist/manifest-oOfTymBS.mjs +1 -0
  155. package/dist/manifest-qXqrO6KC.mjs +2 -0
  156. package/dist/mapsParser-DrJoeC0c.mjs +1 -0
  157. package/dist/modules-CC_ADmwi.mjs +333 -0
  158. package/dist/mojo-ipc-kVztXYw-.mjs +140 -0
  159. package/dist/native-D9ouskXO.mjs +961 -0
  160. package/dist/native-bridge-Dzd7hYoq.mjs +1 -0
  161. package/dist/network-C5Y-S87J.mjs +7 -0
  162. package/dist/one-gadget-CiWFE17F.mjs +1 -0
  163. package/dist/outputPaths-CHtELDyi.mjs +1 -0
  164. package/dist/parse-args-B6dwWc9k.mjs +1 -0
  165. package/dist/platform-BIXgJaM3.mjs +94 -0
  166. package/dist/process-aDIfLC0v.mjs +6 -0
  167. package/dist/proxy-DsHsQ1I4.mjs +2 -0
  168. package/dist/registry-7h8jJ9y9.mjs +1 -0
  169. package/dist/{registry-DH4sc1dt.mjs → registry-DJDnkQW2.mjs} +1 -1
  170. package/dist/response-R8ghbZSb.mjs +1 -0
  171. package/dist/retry-policy-DtYv0kDi.mjs +1 -0
  172. package/dist/reverseEngineeringConfig-BhZLOa3C.mjs +1 -0
  173. package/dist/safeOutput-Dt4mfjXA.mjs +1 -0
  174. package/dist/search-defaults-BBRJNAzC.mjs +1 -0
  175. package/dist/server/plugin-api.mjs +1 -1
  176. package/dist/server/search/EmbeddingWorker.d.mts +1 -0
  177. package/dist/server/search/EmbeddingWorker.mjs +1 -0
  178. package/dist/shared-BKtWZDGN.mjs +1 -0
  179. package/dist/sourcemap-2VIeVeKw.mjs +3 -0
  180. package/dist/streaming-DkpE3GGU.mjs +15 -0
  181. package/dist/syscall-DGZoYM_U.mjs +1 -0
  182. package/dist/transform-BJqsBC_-.mjs +105 -0
  183. package/dist/turbofan-graph-CbGHNVtl.mjs +1 -0
  184. package/dist/turbofan-inspect--NdCuYXi.mjs +23 -0
  185. package/dist/types-CWSvzmIh.mjs +1 -0
  186. package/dist/v8-inspector-CTJo08-K.mjs +297 -0
  187. package/dist/wasm-DX4Qm2Vs.mjs +235 -0
  188. package/dist/weakrefs-inspect-CnhaF-rN.mjs +57 -0
  189. package/dist/webgpu-D4-DxbxZ.mjs +6 -0
  190. package/dist/workflow-DHktRNF2.mjs +108 -0
  191. package/package.json +33 -27
  192. package/dist/AntiCheatDetector-B6d4Qe9D.mjs +0 -1
  193. package/dist/CodeInjector-Cll_7bLJ.mjs +0 -1
  194. package/dist/ConsoleMonitor-CxDJV15E.mjs +0 -306
  195. package/dist/DOMInspector-C19J4zeq.mjs +0 -95
  196. package/dist/DarwinAPI-ZfQdpLNI.mjs +0 -1
  197. package/dist/DetailedDataManager-DmQ1LT-W.mjs +0 -1
  198. package/dist/ExtensionManager-BD724zkO.mjs +0 -1
  199. package/dist/ExtensionManager.tools-oVMJgPcN.mjs +0 -1
  200. package/dist/FingerprintManager-DT0EAUEo.mjs +0 -1
  201. package/dist/HardwareBreakpoint-BUfPdp0f.mjs +0 -1
  202. package/dist/HeapAnalyzer-B_aqY8oj.mjs +0 -1
  203. package/dist/InstrumentationSession-D_G1ZPyd.mjs +0 -1
  204. package/dist/MCPServer.search.handlers.domain-BbS-6LnX.mjs +0 -1
  205. package/dist/MemoryController-X1XNSn1n.mjs +0 -2
  206. package/dist/MemoryScanner-g1_L1ub5.mjs +0 -1
  207. package/dist/NativeMemoryManager.impl-DniBe2wf.mjs +0 -1
  208. package/dist/NetworkMonitor-B_-au6aV.mjs +0 -185
  209. package/dist/PEAnalyzer-yWQaGrcx.mjs +0 -1
  210. package/dist/PageController-Dfsm1_o7.mjs +0 -1
  211. package/dist/PointerChainEngine-BhCUkmxY.mjs +0 -1
  212. package/dist/PrerequisiteError-BjCQA-gK.mjs +0 -1
  213. package/dist/ProcessRegistry-C-bN48oR.mjs +0 -1
  214. package/dist/ReverseEvidenceGraph-BhSYYdiI.mjs +0 -2
  215. package/dist/ScriptManager-LWGPTdvD.mjs +0 -7
  216. package/dist/ServerRuntimeState-D2bWHqEE.mjs +0 -1
  217. package/dist/Speedhack-yseDPSZ9.mjs +0 -1
  218. package/dist/StructureAnalyzer-C5lpuZkg.mjs +0 -2
  219. package/dist/ToolCatalog-CYdD9F5f.mjs +0 -1
  220. package/dist/ToolRegistry-C5oB8KP8.mjs +0 -1
  221. package/dist/ToolRouter.policy-CfhJczkt.mjs +0 -4
  222. package/dist/TraceRecorder-BiJWBXHX.mjs +0 -272
  223. package/dist/VersionDetector-CHT36Az0.mjs +0 -9
  224. package/dist/Win32API-eUCF57l_.mjs +0 -1
  225. package/dist/WorkflowEngine-D876meOO.mjs +0 -1
  226. package/dist/analysis-D4swdMvq.mjs +0 -6
  227. package/dist/apk-packer-BqXcInnX.mjs +0 -1
  228. package/dist/artifactRetention-BCPQASm7.mjs +0 -1
  229. package/dist/artifacts-CkodUM4j.mjs +0 -1
  230. package/dist/binary-instrument-DU7V6TUM.mjs +0 -7
  231. package/dist/binary-secrets-PdMVoyt0.mjs +0 -1
  232. package/dist/boringssl-inspector-BBaJwwkU.mjs +0 -2
  233. package/dist/browser-Qqco2rOT.mjs +0 -11
  234. package/dist/collector-Bpl6qy2L.mjs +0 -1
  235. package/dist/constants-BYj8Xek8.mjs +0 -1
  236. package/dist/coordination-CWXW1o8K.mjs +0 -1
  237. package/dist/dart-inspector-7AkPeZ_Q.mjs +0 -0
  238. package/dist/debugger-DyALjYMk.mjs +0 -1
  239. package/dist/definitions-BWxBke3r.mjs +0 -1
  240. package/dist/definitions-BYwATKc-.mjs +0 -1
  241. package/dist/definitions-B_83XfNQ.mjs +0 -1
  242. package/dist/definitions-Bf3H1EwV.mjs +0 -1
  243. package/dist/definitions-BftdXgXI.mjs +0 -1
  244. package/dist/definitions-Bio5XJYy.mjs +0 -1
  245. package/dist/definitions-C3qNgSn1.mjs +0 -1
  246. package/dist/definitions-CB6vmOer.mjs +0 -1
  247. package/dist/definitions-CMZRSy3k.mjs +0 -1
  248. package/dist/definitions-CQd7yCQH.mjs +0 -1
  249. package/dist/definitions-CT8ln6GQ.mjs +0 -1
  250. package/dist/definitions-D4g-MS10.mjs +0 -1
  251. package/dist/definitions-D5wl_8HN.mjs +0 -1
  252. package/dist/definitions-DAQm1Xar.mjs +0 -1
  253. package/dist/definitions-DP1vgxEY.mjs +0 -1
  254. package/dist/definitions-Ibci7e_L.mjs +0 -1
  255. package/dist/definitions-OeLvmlQy.mjs +0 -1
  256. package/dist/definitions-RZYGD_Ey.mjs +0 -1
  257. package/dist/definitions-Tls8c0A0.mjs +0 -1
  258. package/dist/definitions-bybDvnG0.mjs +0 -26
  259. package/dist/definitions-l7TjdE6V.mjs +0 -1
  260. package/dist/encoding-ycOaz8Vr.mjs +0 -2
  261. package/dist/ensure-browser-core-DxWC-NTp.mjs +0 -1
  262. package/dist/factory-CKr4fAE1.mjs +0 -1
  263. package/dist/flat-target-session-DvcQX7J5.mjs +0 -1
  264. package/dist/graphql-B2TiPEow.mjs +0 -62
  265. package/dist/handlers-8zN_vBIz.mjs +0 -1
  266. package/dist/handlers-B62K4FTc.mjs +0 -1
  267. package/dist/handlers-BpDlVVVU.mjs +0 -1
  268. package/dist/handlers-CMJK7m1c.mjs +0 -31
  269. package/dist/handlers-D2ZOul9p.mjs +0 -54
  270. package/dist/handlers-D5E40ssn.mjs +0 -5
  271. package/dist/handlers-DGbdQAgD.mjs +0 -4
  272. package/dist/handlers-DHO3rjsW.mjs +0 -1
  273. package/dist/handlers-FJ80VzUI.mjs +0 -2
  274. package/dist/handlers-VHWrxbM_.mjs +0 -1
  275. package/dist/handlers-l8QIKqBj.mjs +0 -2
  276. package/dist/handlers.impl-D9Hh8Bgl.mjs +0 -1
  277. package/dist/jadx-search-B_Yse0Zh.mjs +0 -5
  278. package/dist/logger-sBC6IdRT.mjs +0 -1
  279. package/dist/maintenance-BUpIukhg.mjs +0 -1
  280. package/dist/manifest-0Jpt_AQa.mjs +0 -1
  281. package/dist/manifest-B3fZbSWR.mjs +0 -1
  282. package/dist/manifest-B7NB2rh2.mjs +0 -1
  283. package/dist/manifest-BDi4nbH1.mjs +0 -1
  284. package/dist/manifest-BLDfkE7n.mjs +0 -1
  285. package/dist/manifest-BcXbB4gf.mjs +0 -1
  286. package/dist/manifest-Bdnc_vrc.mjs +0 -1
  287. package/dist/manifest-BuYKgCnp.mjs +0 -1
  288. package/dist/manifest-CBfNnGPV.mjs +0 -1
  289. package/dist/manifest-CPS1Xv69.mjs +0 -1
  290. package/dist/manifest-CQH9FhwI.mjs +0 -1
  291. package/dist/manifest-CRryuZF4.mjs +0 -1
  292. package/dist/manifest-CctIumog.mjs +0 -1
  293. package/dist/manifest-CvTe5ZGV2.mjs +0 -1
  294. package/dist/manifest-D-5GH0DV.mjs +0 -1
  295. package/dist/manifest-D3Ssf3IC.mjs +0 -1
  296. package/dist/manifest-D5ck3NvC.mjs +0 -1
  297. package/dist/manifest-D9jUUJAu.mjs +0 -1
  298. package/dist/manifest-DCx6w2XV.mjs +0 -1
  299. package/dist/manifest-DG19q-Ld.mjs +0 -1
  300. package/dist/manifest-DLMlD0Zc.mjs +0 -1
  301. package/dist/manifest-DYpn8w_h.mjs +0 -1
  302. package/dist/manifest-DYzWI8Xs.mjs +0 -1
  303. package/dist/manifest-D_obs5F4.mjs +0 -1
  304. package/dist/manifest-DujQqEQR.mjs +0 -2
  305. package/dist/manifest-DwL2ik8P.mjs +0 -1
  306. package/dist/manifest-ItF5P8A12.mjs +0 -1
  307. package/dist/manifest-KZphqIyX.mjs +0 -1
  308. package/dist/manifest-LG42zPLY2.mjs +0 -1
  309. package/dist/manifest-LLdI5m4T.mjs +0 -1
  310. package/dist/manifest-QYbQXJn0.mjs +0 -1
  311. package/dist/manifest-RcpX_MyZ.mjs +0 -123
  312. package/dist/manifest-YgVd8Sgz.mjs +0 -1
  313. package/dist/manifest-Zy7Odg5J.mjs +0 -1
  314. package/dist/manifest-ff1H7Pdp.mjs +0 -1
  315. package/dist/manifest-iuhF6pTL2.mjs +0 -1
  316. package/dist/manifest-nXHmtMSp2.mjs +0 -1
  317. package/dist/manifest-xWfu6iLo.mjs +0 -1
  318. package/dist/manifest-yC16OhL2.mjs +0 -1
  319. package/dist/manifest-ztWJoXy4.mjs +0 -1
  320. package/dist/matchesWildcardPattern-BAG6LvX5.mjs +0 -1
  321. package/dist/modules-BPBcSaM-.mjs +0 -333
  322. package/dist/mojo-ipc-BhwsdVUW.mjs +0 -9
  323. package/dist/native-j8l473zn.mjs +0 -961
  324. package/dist/network-T0VRwNPd.mjs +0 -7
  325. package/dist/outputPaths-B4Ic4RZh.mjs +0 -2
  326. package/dist/parse-args-Bw413PlW.mjs +0 -1
  327. package/dist/platform-CzaQtISh.mjs +0 -93
  328. package/dist/playwright-cdp-fallback-DqFdx9-s.mjs +0 -1
  329. package/dist/process-CWhsCWrf.mjs +0 -2
  330. package/dist/proxy-DZFlDsG3.mjs +0 -2
  331. package/dist/renderer-pid-9tJnZ_9N.mjs +0 -1
  332. package/dist/response-C7rKQst4.mjs +0 -1
  333. package/dist/search-defaults-lYBVn_3L.mjs +0 -1
  334. package/dist/shared-state-board-BSjXLUV1.mjs +0 -1
  335. package/dist/sourcemap-Dh3Ai_ur.mjs +0 -1
  336. package/dist/streaming-BcJ0B6ao.mjs +0 -1
  337. package/dist/transform-DOxzeWPB.mjs +0 -103
  338. package/dist/types-D9EiE5o9.mjs +0 -1
  339. package/dist/wasm-CZ_HTfKR.mjs +0 -174
  340. package/dist/webcrack-C1iYG_EX.mjs +0 -46
  341. package/dist/workflow-BdwQmARn.mjs +0 -101
  342. /package/dist/{CacheAdapters-CsNtQIR8.mjs → CacheAdapters-BlDrQg8f.mjs} +0 -0
  343. /package/dist/{EventBus-DL8iLA09.mjs → EventBus-Cm-t-B65.mjs} +0 -0
  344. /package/dist/{EvidenceGraphBridge-BtbwXsLC.mjs → EvidenceGraphBridge-DBDc0wUA.mjs} +0 -0
  345. /package/dist/{HookGeneratorBuilders.core.generators.storage-DzD6dIJd.mjs → HookGeneratorBuilders.core.generators.storage-CWaWpOHa.mjs} +0 -0
  346. /package/dist/{RingBuffer-Dm54ELKT.mjs → RingBuffer-B6RTHmij.mjs} +0 -0
  347. /package/dist/{StealthVerifier-BmcxfwSF.mjs → StealthVerifier-DMBrtkhN.mjs} +0 -0
  348. /package/dist/{ToolError-DWU_z7gp.mjs → ToolError-g3rjWzhx.mjs} +0 -0
  349. /package/dist/{authorization-schema-BOFwSXUN.mjs → authorization-schema-Jtikc5Yt.mjs} +0 -0
  350. /package/dist/{bind-helpers-m2U8glkF.mjs → bind-helpers-D0mGAOof.mjs} +0 -0
  351. /package/dist/{concurrency-DCr8WQ2M.mjs → concurrency-Dehnw4JC.mjs} +0 -0
  352. /package/dist/{evidence-graph-bridge-CV_UdYqj.mjs → evidence-graph-bridge-eT9icP6a.mjs} +0 -0
  353. /package/dist/{formatAddress-vLA_hOJt.mjs → formatAddress-DAcw4Ckg.mjs} +0 -0
  354. /package/dist/{chunk-C_pMuVsO.mjs → rolldown-runtime-88NL7fhV.mjs} +0 -0
  355. /package/dist/{ssrf-policy-CsIJGkpd.mjs → ssrf-policy-B72vdy23.mjs} +0 -0
  356. /package/dist/{tool-builder-qif8M9-K.mjs → tool-builder-CpLh-UQd.mjs} +0 -0
  357. /package/dist/{types-Fz69RzbZ.mjs → types-BzPBzmVB.mjs} +0 -0
@@ -0,0 +1,4 @@
1
+ import{n as e,r as t,t as n}from"./logger-BGCcd-jJ.mjs";import{Ca as r,Ct as i,Da as a,Sa as o,bt as s,wa as c,xt as l}from"./constants-nvsLpSri.mjs";import{n as u,t as d}from"./artifactRetention-Bk6fW2uF.mjs";import{t as f}from"./config-5ODJ3Aj0.mjs";import{i as p}from"./outputPaths-CHtELDyi.mjs";import{i as m,n as h}from"./response-R8ghbZSb.mjs";import{t as g}from"./types-BzPBzmVB.mjs";import{r as _}from"./concurrency-Dehnw4JC.mjs";import{r as v}from"./betterSqlite3-Bdo_ifuJ.mjs";import{r as y}from"./ResponseBuilder-BLicSCjn.mjs";import{t as b}from"./ToolRegistry-CzqQxFqf.mjs";import"./definitions-DtOY5iUc.mjs";import{t as x}from"./QuickJSSandbox-CIde-jzG.mjs";import{createRequire as S}from"node:module";import{existsSync as C}from"node:fs";import{dirname as w,isAbsolute as ee,join as T,relative as te,resolve as E}from"node:path";import{mkdir as D,readFile as O,writeFile as k}from"node:fs/promises";import{fileURLToPath as ne}from"node:url";import{promisify as A}from"node:util";import{createHash as re,randomUUID as ie}from"node:crypto";import{execFile as j}from"node:child_process";const M=A(j),N=S(import.meta.url);let P=null,F=0;function ae(){let e=Date.now();return(!P||e-F>12e4)&&(P=new b,F=e),P}function oe(e){let t=w(N.resolve(e));for(;;){let n=T(t,`package.json`);if(C(n))return n;let r=w(t);if(r===t)throw Error(`Could not locate package.json for ${e}`);t=r}}function I(e){return N(oe(e))}async function se(e){let t=e?.includeBridgeHealth??!0,n=ae().probeAll(!0),r=_(()=>z(`git`,[`--version`])),i=_(()=>z(`python`,[`--version`])),o=_(()=>le()),s=_(()=>z(`corepack`,[`--version`])),l=t?Promise.all([_(()=>V(`ghidra-bridge`,`${c.replace(/\/$/,``)}/health`)),_(()=>V(`ida-bridge`,`${a.replace(/\/$/,``)}/health`)),_(()=>V(`burp-mcp-sse`,process.env.BURP_MCP_SSE_URL?.trim()||`http://127.0.0.1:9876`))]):Promise.resolve([]),[d,f,m,h,g,v]=await Promise.all([n,r,i,o,s,l]),y=ue(g,h),b=[L(`@modelcontextprotocol/sdk`),L(`rebrowser-puppeteer-core`),ce(),L(`camoufox-js`,`Optional Firefox anti-detect driver`),L(`playwright-core`,`Optional browser automation dependency`),de()],x=[f,m,h,y,...Object.entries(d).map(([e,t])=>({name:e,status:t.available?`ok`:`missing`,detail:t.available?`${t.path??`PATH`}${t.version?` (${t.version})`:``}`:t.reason??`Unavailable`}))],S=fe(),C=pe(b,x,v,S);return{success:[...b,...x,...v].every(e=>e.status!==`error`),generatedAt:new Date().toISOString(),runtime:{platform:process.platform,arch:process.arch,node:process.version,cwd:process.cwd(),projectRoot:p()},packages:b,commands:x,bridges:v,config:{transport:(process.env.MCP_TRANSPORT??`stdio`).toLowerCase(),toolProfile:(process.env.MCP_TOOL_PROFILE??`search`).toLowerCase(),pluginRoots:process.env.MCP_PLUGIN_ROOTS??`<jshook-install>/plugins`,workflowRoots:process.env.MCP_WORKFLOW_ROOTS??`<jshook-install>/workflows`,pluginSignatureRequired:process.env.MCP_PLUGIN_SIGNATURE_REQUIRED??(process.env.NODE_ENV===`production`?`true (production default)`:`false`),pluginStrictLoad:process.env.MCP_PLUGIN_STRICT_LOAD??(process.env.NODE_ENV===`production`?`true (production default)`:`false`),artifactRetention:u()},limitations:S,recommendations:C}}function L(e,t){try{let t=I(e);return{name:e,status:`ok`,detail:t.version?`installed (${t.version})`:`installed`}}catch{return{name:e,status:`missing`,detail:t??`Not installed`}}}function ce(){let e=v();return{name:`better-sqlite3`,status:e.status,detail:e.detail}}function R(e){return e.status===`ok`||e.detail.includes(`npx fallback works`)}async function le(){let e=await z(`pnpm`,[`--version`]);if(e.status===`ok`)return e;let t=await z(`npx`,[`pnpm`,`--version`],1e4);return t.status===`ok`?{name:`pnpm`,status:`warn`,detail:`direct pnpm command unavailable; npx fallback works (${t.detail})`}:e}function ue(e,t){return e.status!==`missing`||!R(t)?e:{name:e.name,status:`warn`,detail:process.platform===`win32`?t.detail.includes(`npx fallback works`)?"corepack not found; use `npx pnpm` directly (common with nvm4w-managed Node on Windows)":`corepack not found; standalone pnpm is available (common with nvm4w-managed Node on Windows)`:t.detail.includes(`npx fallback works`)?"corepack not found; use `npx pnpm` directly":`corepack not found; standalone pnpm is available`}}function de(){try{let e=I(`koffi`).version??`unknown`;if(process.platform===`win32`)return{name:`native-memory`,status:`ok`,detail:`koffi ${e} — Win32 kernel32.dll available`};if(process.platform===`darwin`)try{return N("koffi").load(`/usr/lib/libSystem.B.dylib`).unload(),delete N.cache[N.resolve(`koffi`)],{name:`native-memory`,status:`ok`,detail:`koffi ${e} — macOS libSystem.B.dylib available (Mach APIs need root + SIP config)`}}catch{return{name:`native-memory`,status:`warn`,detail:`koffi ${e} installed but cannot load libSystem.B.dylib`}}return{name:`native-memory`,status:`warn`,detail:`koffi ${e} — no native FFI memory provider for ${process.platform} (proc-based ops available on Linux)`}}catch{return{name:`native-memory`,status:`missing`,detail:`koffi not installed — native memory tools unavailable. Install with: pnpm add koffi`}}}async function z(e,t,n=4e3){try{let{stdout:r,stderr:i}=await M(e,t,{timeout:n,windowsHide:!0});return{name:e,status:`ok`,detail:`${r||i}`.trim().split(/\r?\n/)[0]||`available`}}catch(r){if(process.platform===`win32`)try{let{stdout:r,stderr:i}=await M(`cmd`,[`/c`,e,...t],{timeout:n,windowsHide:!0});return{name:e,status:`ok`,detail:`${`${r||i}`.trim().split(/\r?\n/)[0]||`available`} (via cmd)`}}catch(t){return B(e,t)}return B(e,r)}}function B(e,t){let n=t instanceof Error?t.message:String(t);return{name:e,status:/ENOENT|not recognized|not found/i.test(n)?`missing`:`warn`,detail:n}}async function V(e,t){try{let n=await fetch(t,{method:`GET`,signal:AbortSignal.timeout(3e3)});return{name:e,status:n.ok?`ok`:`warn`,detail:`${t} -> HTTP ${n.status}`}}catch(n){return{name:e,status:`warn`,detail:`${t} -> ${n instanceof Error?n.message:String(n)}`}}}function fe(){let e=[];return process.platform===`darwin`?(e.push(`26 cross-platform memory tools available (scan, pointer-chain, structure-analysis, heap). 15 Windows-only tools unavailable (PE analysis, anti-cheat, code injection, speedhack, hardware breakpoints).`),e.push(`Native memory operations (mach_vm_read/write) require root privileges and may require SIP configuration on ARM64.`)):process.platform===`linux`?(e.push(`Process management available via /proc. Native FFI memory provider not implemented — memory read/write uses /proc/pid/mem (requires root or CAP_SYS_PTRACE).`),e.push(`Camoufox runs on Linux, but some Chrome/CDP-heavy workflows are better served by the Chrome driver.`)):process.platform!==`win32`&&e.push(`Platform ${process.platform} is not supported for native memory operations. Use Windows or macOS.`),e}function pe(e,t,n,r){let i=[],a=t.find(e=>e.name===`pnpm`),o=t.find(e=>e.name===`corepack`);return e.some(e=>e.name===`better-sqlite3`&&e.status!==`ok`)&&i.push("Install or rebuild the optional SQLite trace backend with `pnpm add -O better-sqlite3@12.10.0` or `npm rebuild better-sqlite3 --foreground-scripts` under the active Node version if you need trace tooling."),e.some(e=>e.name===`camoufox-js`&&e.status!==`ok`)&&i.push("Install optional browser dependencies with `pnpm run install:full` if you need Camoufox support."),t.some(e=>e.name.startsWith(`wabt.`)&&e.status!==`ok`)&&i.push(`Install wabt if you need full WASM disassembly/decompilation; otherwise the server will stay in basic mode.`),a&&!R(a)?i.push("Install pnpm or enable Corepack (`corepack enable`) before running package-management workflows."):a?.detail.includes(`npx fallback works`)?i.push("Use `npx pnpm` directly on this machine or repair the local pnpm/Corepack shim if scripts expect bare `pnpm`."):o?.status===`warn`&&o.detail.includes(`standalone pnpm`)&&i.push("Use `pnpm` or `npx pnpm` directly on this machine; `corepack` is optional and may be absent on nvm4w-managed Windows installs."),n.some(e=>e.status!==`ok`)&&i.push(`Check local bridge endpoints (Ghidra / IDA / Burp) before relying on native-bridge workflows.`),r.length>0&&i.push(`Review platform limitations before using process/memory tooling on non-Windows hosts.`),i}A(j);const me=new Set([`t4`,`a10g`,`l4`,`a100`,`h100`,`tesla t4`,`tesla v100`,`tesla p100`,`tesla p40`,`tesla p4`,`a10`,`a40`]),he=[{pattern:/vmware/i,name:`VMware SVGA`},{pattern:/virtualbox/i,name:`VirtualBox Graphics`},{pattern:/parallels/i,name:`Parallels Display`},{pattern:/qxl/i,name:`QXL (QEMU/KVM)`},{pattern:/hyper-v/i,name:`Hyper-V Synthetic`},{pattern:/virtio/i,name:`VirtIO GPU (KVM)`},{pattern:/red hat.*virtio/i,name:`Red Hat VirtIO`},{pattern:/microsoft basic render/i,name:`Microsoft Basic Render`},{pattern:/microsoft hyper-v/i,name:`Microsoft Hyper-V Video`}];function ge(e){let t=e.toLowerCase().trim(),n=[...me].find(e=>t.includes(e)),r=he.find(({pattern:e})=>e.test(t));return{model:e,isCloudGpu:!!n,isVirtualMachine:!!r,reason:n?`Cloud GPU: matched "${n}"`:r?`VM GPU: matched "${r.name}"`:`Local / physical GPU`}}function _e(e){let t=[[`webglRenderer`,e.webglRenderer],[`webgpuDescription`,e.webgpuDescription],[`deviceName`,e.deviceName]],n=[];for(let[,e]of t)typeof e!=`string`||e.trim().length===0||n.push({vendor:ve(e),model:e});let r=n.map(e=>ge(e.model));return{gpus:n,classifications:r,isCloudGpu:r.some(e=>e.isCloudGpu),isVirtualMachine:r.some(e=>e.isVirtualMachine),method:`caller-supplied renderer strings`}}function ve(e){let t=e.toLowerCase();return/nvidia|geforce|quadro|tesla|rtx|gtx/.test(t)?`NVIDIA`:/amd|radeon|firepro|vega|rx\s*\d/.test(t)?`AMD`:/intel|hd graphics|uhd|iris|arc/.test(t)?`Intel`:/apple|m1|m2|m3|m4/.test(t)?`Apple`:/vmware|virtualbox|parallels|qxl|hyper-v|virtio|red hat/.test(t)?`VM`:`unknown`}var ye=class{tokenBudget;unifiedCache;artifactCleanup;environmentDoctor;constructor(e){this.tokenBudget=e.tokenBudget,this.unifiedCache=e.unifiedCache,this.artifactCleanup=e.artifactCleanup??d,this.environmentDoctor=e.environmentDoctor??se}async handleGetTokenBudgetStats(){return y(async()=>{let e=this.tokenBudget.getStats();return{...e,sessionDuration:`${Math.round((Date.now()-e.sessionStartTime)/1e3)}s`}})}async handleManualTokenCleanup(){return y(async()=>{let e=this.tokenBudget.getStats();this.tokenBudget.manualCleanup();let t=this.tokenBudget.getStats(),n=e.currentUsage-t.currentUsage;return{message:`Manual cleanup completed`,before:{usage:e.currentUsage,percentage:e.usagePercentage},after:{usage:t.currentUsage,percentage:t.usagePercentage},freed:{tokens:n,percentage:Math.round(n/e.maxTokens*100)}}})}async handleResetTokenBudget(){return y(async()=>(this.tokenBudget.reset(),{message:`Token budget reset successfully`,currentUsage:0,maxTokens:2e5,usagePercentage:0}))}async handleGetCacheStats(){return y(async()=>this.unifiedCache.getGlobalStats())}async handleSmartCacheCleanup(e,t){return y(async()=>this.unifiedCache.smartCleanup(e,t&&t.length>0?{namespaces:t}:void 0))}async handleClearAllCaches(){return y(async()=>(await this.unifiedCache.clearAll(),{message:`All caches cleared`}))}async handleCleanupArtifacts(e){return y(async()=>this.artifactCleanup({retentionDays:e.retentionDays,maxTotalBytes:e.maxTotalBytes,dryRun:e.dryRun,...e.categories?{categories:e.categories}:{},...e.excludeCategories?{excludeCategories:e.excludeCategories}:{}}))}async handleEnvironmentDoctor(e){return y(async()=>this.environmentDoctor({includeBridgeHealth:e.includeBridgeHealth}))}async handleDetectGpu(e){return y(async()=>_e({webglRenderer:typeof e.webglRenderer==`string`?e.webglRenderer:void 0,webgpuDescription:typeof e.webgpuDescription==`string`?e.webgpuDescription:void 0,deviceName:typeof e.deviceName==`string`?e.deviceName:void 0}))}};const H=A(j);function be(){return ne(new URL(`../../../../`,import.meta.url))}function xe(e){let t=e?.trim();if(t)return t.split(`,`).map(e=>e.trim()).find(e=>e.length>0)}function Se(e){let t=e===`workflow`?`MCP_WORKFLOW_ROOTS`:`MCP_PLUGIN_ROOTS`,n=xe(process.env[t]);return n?E(n):E(be(),e===`workflow`?`workflows`:`plugins`)}function U(){let e=(process.env.EXTENSION_REGISTRY_BASE_URL??``).trim().replace(/\/+$/,``);if(!e)throw Error(`EXTENSION_REGISTRY_BASE_URL is not configured. Set it in .env or environment before browsing or installing extensions.`);return e}function W(e,t){let n=e?.trim();if(!n){if(t===`subpath`)return`.`;throw Error(`Registry source.${t} must be a non-empty string`)}return n}function G(e,t,n){let r=te(e,t).replace(/\\/g,`/`);if(r===`..`||r.startsWith(`../`)||ee(r))throw Error(`Registry source.${n} must stay within ${e}: ${t}`)}function Ce(e,t){let n=E(e,W(t,`subpath`));return G(e,n,`subpath`),n}function K(e,t){let n=E(e,W(t,`entry`));return G(e,n,`entry`),n}function we(e){let t=W(e,`entry`).replace(/\\/g,`/`),n=[t];if(!t.endsWith(`.ts`))return n;let r=`${t.slice(0,-3)}.js`;return n.unshift(r),t.startsWith(`dist/`)||n.unshift(`dist/${r}`),[...new Set(n)]}function Te(e,t){let n=we(t);for(let t of n)if(C(K(e,t)))return t;return W(t,`entry`)}async function Ee(e,t,n,r){let i={version:1,kind:e,slug:t.slug,id:t.id,source:{type:t.source.type,repo:t.source.repo,ref:t.source.ref,commit:t.source.commit,subpath:W(t.source.subpath,`subpath`),entry:W(r,`entry`)}},a=E(n,g);return await k(a,`${JSON.stringify(i,null,2)}\n`,`utf8`),a}const q=`@jshookmcp/extension-sdk`,De=[`workspace:`,`link:`,`file:`];function Oe(){return f().paths.registryCacheDir}var J=class extends Error{code;url;cachePath;status;constructor(e,t,n,r,i){super(n),this.code=e,this.url=t,this.cachePath=r,this.status=i,this.name=`RegistryFetchError`}};function ke(e){return process.platform===`win32`?e.endsWith(`.cmd`)||e.endsWith(`.exe`)?e:`${e}.cmd`:e}function Ae(e,t){return{command:ke(e),args:t}}async function Y(e,t,n){let r=Ae(e,t);return H(r.command,r.args,{...n,env:{...process.env,...n?.env,CI:`true`}})}async function je(e){let t=E(e,`package.json`),n=E(e,`pnpm-lock.yaml`),r=E(e,`package-lock.json`);if(C(t))try{let e=await O(t,`utf8`),n=JSON.parse(e).packageManager?.trim().toLowerCase().split(`@`)[0];if(n===`pnpm`)return`pnpm`;if(n===`npm`)return`npm`}catch{}return C(n)?`pnpm`:C(r)?`npm`:`pnpm`}function X(e){return E(Oe(),`registry-${e}.json`)}async function Me(e){let t=X(e);try{let e=await O(t,`utf8`);return JSON.parse(e)}catch{return null}}async function Ne(e,t){let n=X(e);await D(w(n),{recursive:!0}),await k(n,JSON.stringify(t,null,2),`utf8`)}function Pe(e,t,n){if(t instanceof J)return t;if(t instanceof DOMException&&t.name===`AbortError`)return new J(`timeout`,e,`Registry fetch timed out after 10000ms: ${e}`,n);let r=t instanceof Error?t.message:String(t);if(r.includes(`ENOTFOUND`)||r.includes(`getaddrinfo`))return new J(`dns_failure`,e,`DNS resolution failed for registry URL: ${e}`,n);if(r.includes(`ECONNREFUSED`))return new J(`connection_refused`,e,`Connection refused by registry server: ${e}`,n);if(r.includes(`CERT_`)||r.includes(`certificate`)||r.includes(`SSL`))return new J(`tls_error`,e,`TLS/certificate error when connecting to registry: ${e}`,n);let i=r.match(/HTTP\s+(\d+)/i);return i?new J(`http_error`,e,r,n,Number(i[1])):new J(`fetch_failed`,e,r,n)}function Fe(e){return{success:!1,error:e.code,message:e.message,url:e.url,...typeof e.status==`number`?{status:e.status}:{}}}async function Z(e,t){let r=new AbortController,i=setTimeout(()=>r.abort(),1e4),a=t?.cacheKey?X(t.cacheKey):void 0;try{let i=await fetch(e,{signal:r.signal});if(!i.ok)throw new J(`http_error`,e,`HTTP ${i.status} ${i.statusText} from ${e}`,a,i.status);let o=await i.json();if(t?.cacheKey)try{await Ne(t.cacheKey,o)}catch(r){n.warn(`[extensions] Failed to persist ${t.cacheKey} registry cache for ${e}:`,r)}return{data:o,stale:!1,source:`network`,cachePath:a}}catch(r){let i=Pe(e,r,a);if(t?.cacheKey){let r=await Me(t.cacheKey);if(r)return n.warn(`[extensions] Using stale ${t.cacheKey} registry cache after ${i.code}: ${e}`),{data:r,stale:!0,source:`cache`,cachePath:a}}throw i}finally{clearTimeout(i)}}function Ie(e){let t=e.trim();return t?De.some(e=>t.startsWith(e))||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)?!0:/^[A-Za-z]:[\\/]/.test(t):!1}async function Le(e){let t=await O(E(e,`package.json`),`utf8`),n=JSON.parse(t);for(let e of[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`]){let t=n[e];if(!t||typeof t!=`object`)continue;let r=t[q];if(typeof r==`string`&&Ie(r))throw Error(`package.json ${e}.${q} uses unsupported local dependency spec "${r}". Declare a published npm version instead, for example "^0.3.2".`)}}async function Re(e,t){let[n,r]=await Promise.allSettled([Z(`${e}/workflows.index.json`,{cacheKey:`workflows`}),Z(`${e}/plugins.index.json`,{cacheKey:`plugins`})]);if(n.status===`fulfilled`){let e=(Array.isArray(n.value.data.workflows)?n.value.data.workflows:[]).find(e=>e.slug===t);if(e)return{entry:e,kind:`workflow`}}if(r.status===`fulfilled`){let e=(Array.isArray(r.value.data.plugins)?r.value.data.plugins:[]).find(e=>e.slug===t);if(e)return{entry:e,kind:`plugin`}}let i=n.status===`rejected`?n.reason instanceof Error?n.reason:Error(String(n.reason)):void 0,a=r.status===`rejected`?r.reason instanceof Error?r.reason:Error(String(r.reason)):void 0;throw Error(i&&a?`Failed to resolve extension slug "${t}": workflow registry error: ${i.message}; plugin registry error: ${a.message}`:a?`Extension "${t}" was not found in workflow registry, and plugin registry lookup failed: ${a.message}`:i?`Extension "${t}" was not found in plugin registry, and workflow registry lookup failed: ${i.message}`:`Extension "${t}" not found in workflow or plugin registry`)}function ze(e,t){let n=e;for(let e=0;e<32;e++){let e=T(n,t);if(C(e))return{dir:n,path:e};let r=w(n);if(r===n)return null;n=r}return null}async function Q(e){try{let t=await O(e,`utf8`);return JSON.parse(t)}catch{return}}async function Be(e){try{let t=await O(e);return re(`sha256`).update(t).digest(`hex`)}catch{return}}async function Ve(e,t){let n=w(e),r=await Be(e),i=ze(n,t),a,o,s,c=n;if(i){a=!0,c=i.dir;let e=await Q(i.path);if(e){let t=e.source?.commit;typeof t==`string`&&t.trim().length>0&&(o=t.trim()),typeof e.slug==`string`&&e.slug.trim().length>0&&(s=e.slug.trim())}}else a=!1;let l=await Q(T(c,`package.json`)),u;l&&typeof l.version==`string`&&(u=l.version.trim()||void 0);let d={source:e};return u!==void 0&&(d.version=u),r!==void 0&&(d.digest=r),a!==void 0&&(d.managed=a),o!==void 0&&(d.pinnedCommit=o),s!==void 0&&(d.slug=s),d}async function He(e,t){let n=[...e.plugins.map(e=>e.source),...e.workflows.map(e=>e.source)],r=[...new Set(n.filter(e=>typeof e==`string`))],i=await Promise.allSettled(r.map(e=>Ve(e,t))),a=[];for(let e of i)e.status===`fulfilled`&&a.push(e.value);return{entries:a,managedCount:a.filter(e=>e.managed===!0).length,digestedCount:a.filter(e=>e.digest!==void 0).length}}var Ue=class{ctx;constructor(e){this.ctx=e}async handleListExtensions(e={}){try{let t=this.ctx.listExtensions();if(!e.includeIntegrity)return h({success:!0,...t});try{let e=await He(t,g),n=new Map(e.entries.map(e=>[e.source,e])),r=e=>{let t=n.get(e.source);if(!t)return e;let{source:r,...i}=t;return{...e,integrity:i}};return h({success:!0,...t,plugins:t.plugins.map(r),workflows:t.workflows.map(r),integrity:{managedCount:e.managedCount,digestedCount:e.digestedCount,entryCount:e.entries.length}})}catch(e){return n.warn(`Failed to enrich extension integrity:`,e),h({success:!0,...t})}}catch(e){return n.error(`Failed to list extensions:`,e),h(m(e))}}async handleReloadExtensions(){try{return h({success:!0,...await this.ctx.reloadExtensions()})}catch(e){return n.error(`Failed to reload extensions:`,e),h(m(e))}}async handleBrowseExtensionRegistry(e){try{let t=U(),n=e===`all`||e===`plugin`,r=e===`all`||e===`workflow`,i={success:!0},a=!1,o=n?Z(`${t}/plugins.index.json`,{cacheKey:`plugins`}):void 0,s=r?Z(`${t}/workflows.index.json`,{cacheKey:`workflows`}):void 0,[c,l]=await Promise.all([o??Promise.resolve(void 0),s??Promise.resolve(void 0)]);if(c){let e=Array.isArray(c.data.plugins)?c.data.plugins:[];i.plugins=e.map(e=>({slug:e.slug,id:e.id,name:e.meta.name,description:e.meta.description,author:e.meta.author,repo:e.source.repo,commit:e.source.commit,entry:e.source.entry})),i.pluginCount=e.length,i.pluginSource=c.source,a||=c.stale}if(l){let e=Array.isArray(l.data.workflows)?l.data.workflows:[];i.workflows=e.map(e=>({slug:e.slug,id:e.id,name:e.meta.name,description:e.meta.description,author:e.meta.author,repo:e.source.repo,commit:e.source.commit,entry:e.source.entry})),i.workflowCount=e.length,i.workflowSource=l.source,a||=l.stale}return a&&(i.stale=!0),h(i)}catch(e){return n.error(`Failed to browse extension registry:`,e),e instanceof J?h(Fe(e)):h(m(e))}}async handleInstallExtension(e,t){try{let{entry:n,kind:i}=await Re(U(),e),a=i===`workflow`,s=Se(a?`workflow`:`plugin`),c=t?E(t):E(s,e),l=Ce(c,n.source.subpath);if(K(l,n.source.entry),C(c))return h({success:!1,error:`Target directory already exists: ${c}`,hint:`Remove the existing directory first, or specify a different targetDir`});await D(w(c),{recursive:!0});let u=process.platform===`win32`?`git.exe`:`git`;if(await H(u,[`clone`,n.source.repo,c],{timeout:r}),await H(u,[`-C`,c,`checkout`,n.source.commit],{timeout:o}),C(E(l,`package.json`))){await Le(l);let e=await je(l);await Y(e,e===`pnpm`?[`--ignore-workspace`,`install`,`--no-frozen-lockfile`,`--ignore-scripts`]:[`install`,`--ignore-scripts`],{cwd:l,timeout:Math.max(r,12e4)}),await Y(e,e===`pnpm`?[`--ignore-workspace`,`run`,`--if-present`,`build`]:[`run`,`build`,`--if-present`],{cwd:l,timeout:Math.max(r,12e4)})}let d=Te(l,n.source.entry),f=K(l,d);if(!C(f))return h({success:!1,error:`Installed extension entry not found: ${d}`,installDir:c,projectDir:l,expectedEntryFile:f,hint:`The registry source.entry or its compiled JS output must exist after clone/build before reloadExtensions can load it.`});let p=await Ee(a?`workflow`:`plugin`,n,l,d),m=await this.ctx.reloadExtensions();return h({success:!0,installed:{slug:n.slug,id:n.id,name:n.meta.name,repo:n.source.repo,commit:n.source.commit,installDir:c,projectDir:l,entry:d,entryFile:f,metadataPath:p},reload:{addedTools:m.addedTools,pluginCount:m.pluginCount,workflowCount:m.workflowCount,errors:m.errors,warnings:m.warnings}})}catch(e){return n.error(`Failed to install extension:`,e),h(m(e))}}},We=class{ctx;allowlist=null;pendingCalls=[];constructor(e,t={}){this.ctx=e,t.allowedTools!==void 0&&this.setAllowlist(t.allowedTools)}setAllowlist(e){this.allowlist=e?new Set(e):null}assertCallable(e){if(!(this.ctx.selectedTools?.map(e=>e.name)??[]).includes(e))throw Error(`Tool "${e}" is not a registered MCP tool`);if(this.allowlist&&!this.allowlist.has(e))throw Error(`Tool "${e}" is not in the sandbox allowlist`)}enqueue(e,t={}){this.assertCallable(e);let n=ie().slice(0,8);return this.pendingCalls.push({id:n,toolName:e,args:t}),n}drainPending(){let e=[...this.pendingCalls];return this.pendingCalls.length=0,e}hasPending(){return this.pendingCalls.length>0}async call(e,t={}){this.assertCallable(e);let n=await this.ctx.executeToolWithTracking(e,t);if(n.content&&Array.isArray(n.content)){let e=[];for(let t of n.content)t.type===`text`&&e.push(t.text);let t=e.join(`
2
+ `);try{return JSON.parse(t)}catch{return t}}return n}listAvailableTools(){let e=this.ctx.selectedTools.map(e=>e.name);return this.allowlist?e.filter(e=>this.allowlist.has(e)):e}},Ge=class{store=new Map;set(e,t,n){let r=this.store.get(e);r||(r=new Map,this.store.set(e,r)),r.set(t,JSON.stringify(n))}get(e,t){let n=this.store.get(e);if(!n)return;let r=n.get(t);if(r!==void 0)try{return JSON.parse(r)}catch{return r}}getAll(e){let t=this.store.get(e);if(!t)return{};let n={};for(let[e,r]of t)try{n[e]=JSON.parse(r)}catch{n[e]=r}return n}keys(e){let t=this.store.get(e);return t?Array.from(t.keys()):[]}clear(e){this.store.delete(e)}clearAll(){this.store.clear()}};async function Ke(e,t,n={},r=2){let i=null,a=t;for(let o=0;o<=r;o++){if(i=await e.execute(a,n),i.ok||i.timedOut)return{...i,retryCount:o};o<r&&(a=`/* Previous error (attempt ${o+1}): ${i.error??`unknown error`} */\n${t}`)}return{...i,retryCount:r}}const qe=s*1024*1024;function $(e){return{content:[{type:`text`,text:JSON.stringify({ok:!1,error:e})}]}}function Je(e,t,n){let r=Number(e);return Number.isFinite(r)?Math.min(Math.max(t,Math.floor(r)),n):`value must be a finite number`}function Ye(e){if(e===void 0)return;if(!Array.isArray(e))return`allowedTools must be an array of tool names`;let t=[];for(let n of e){if(typeof n!=`string`||n.trim().length===0)return`allowedTools must contain only non-empty strings`;t.push(n.trim())}return[...new Set(t)]}var Xe=class{ctx;scratchpad=new Ge;constructor(e){this.ctx=e}async handleExecuteSandboxScript(n){let r=n.code,a=n.sessionId??void 0,o=n.timeoutMs??void 0,s=n.memoryLimitBytes??void 0,c=n.autoCorrect??!1,u=n.redactOutput??!0;if(!r||typeof r!=`string`)return $(`code parameter is required`);let d=Ye(n.allowedTools);if(typeof d==`string`)return $(d);let f=new x,p=new We(this.ctx,{allowedTools:d});f.setBridge(p);let m={};if(o!==void 0){let e=Je(o,1,l);if(typeof e==`string`)return $(`timeoutMs ${e}`);m.timeoutMs=e}if(s!==void 0){let e=Je(s,i,qe);if(typeof e==`string`)return $(`memoryLimitBytes ${e}`);m.memoryLimitBytes=e}if(a){m.sessionId=a;let e=this.scratchpad.getAll(a);m.globals={...m.globals,__scratchpad:e}}let h;if(h=c?await Ke(f,r,m):await f.execute(r,m),a&&h.ok&&h.output&&typeof h.output==`object`){let e=h.output;if(e.__scratchpad&&typeof e.__scratchpad==`object`)for(let[t,n]of Object.entries(e.__scratchpad))this.scratchpad.set(a,t,n)}let g=u?h.logs.map(t):h.logs,_=u?e(h.output):h.output,v=u&&h.error?t(h.error):h.error;return{content:[{type:`text`,text:[`**Status:** ${h.ok?`✓ Success`:`✗ Failed`}`,h.timedOut?`**Timed out:** yes`:``,`**Duration:** ${h.durationMs}ms`,g.length>0?`**Console output:**\n\`\`\`\n${g.join(`
3
+ `)}\n\`\`\``:``,_===void 0?``:`**Result:** ${JSON.stringify(_)}`,v?`**Error:** ${v}`:``].filter(Boolean).join(`
4
+ `)}]}}};export{ye as CoreMaintenanceHandlers,Ue as ExtensionManagementHandlers,Xe as SandboxToolHandlers};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";const n=[`TLSv1`,`TLSv1.1`,`TLSv1.2`,`TLSv1.3`];function r(e,t,n={},r=[]){return{name:e,description:t,inputSchema:{type:`object`,properties:n,required:r}}}const i=[r(`tls_cert_pin_bypass_frida`,`Bypass certificate pinning via Frida injection (supports the target TLS library and HTTP client frameworks).`)],a=[r(`net_raw_tcp_send`,`Send raw TCP data to a remote host; accepts hex or text input.`,{host:{type:`string`,default:`127.0.0.1`,description:`Target host address`},port:{type:`number`,description:`Target port number (1-65535)`},dataHex:{type:`string`,description:`Hex-encoded data to send`},dataText:{type:`string`,description:`Text data to send (alternative to dataHex)`},timeout:{type:`number`,default:5e3,description:`Connection timeout in ms`}},[`port`]),r(`net_raw_tcp_listen`,`Listen on a local TCP port for one incoming connection.`,{port:{type:`number`,description:`Local port to listen on (1-65535)`},timeout:{type:`number`,default:1e4,description:`Listen timeout in ms`}},[`port`]),r(`net_raw_udp_send`,`Send a raw UDP datagram and wait for a response.`,{host:{type:`string`,default:`127.0.0.1`,description:`Target host address`},port:{type:`number`,description:`Target port number (1-65535)`},dataHex:{type:`string`,description:`Hex-encoded data to send`},dataText:{type:`string`,description:`Text data to send (alternative to dataHex)`},timeout:{type:`number`,default:5e3,description:`Response timeout in ms`}},[`port`]),r(`net_raw_udp_listen`,`Listen on a local UDP port for an incoming datagram.`,{port:{type:`number`,description:`Local port to listen on (1-65535)`},timeout:{type:`number`,default:1e4,description:`Listen timeout in ms`}},[`port`])],o=[r(`tcp_open`,`Open a TCP session.`,{host:{type:`string`,default:`127.0.0.1`,description:`Target host name or IP address`},port:{type:`number`,description:`Target TCP port`},timeoutMs:{type:`number`,default:5e3,description:`Connection timeout in milliseconds`},noDelay:{type:`boolean`,default:!0,description:`Enable TCP_NODELAY on the socket after connect`}},[`port`]),r(`tcp_write`,`Write data to an open TCP session.`,{sessionId:{type:`string`,description:`TCP session ID`},dataHex:{type:`string`,description:`Hex-encoded payload to write`},dataText:{type:`string`,description:`UTF-8 text payload to write`},timeoutMs:{type:`number`,default:5e3,description:`Write timeout in milliseconds`}},[`sessionId`]),r(`tcp_read_until`,`Read from an open TCP session until a delimiter or byte limit is reached.`,{sessionId:{type:`string`,description:`TCP session ID`},delimiterHex:{type:`string`,description:`Hex-encoded delimiter to stop at`},delimiterText:{type:`string`,description:`UTF-8 delimiter to stop at`},includeDelimiter:{type:`boolean`,default:!0,description:`Include the delimiter bytes in the returned payload`},maxBytes:{type:`number`,description:`Optional maximum number of bytes to return even if no delimiter matches`},timeoutMs:{type:`number`,default:5e3,description:`Read timeout in milliseconds`}},[`sessionId`]),r(`tcp_close`,`Close an open TCP session.`,{sessionId:{type:`string`,description:`TCP session ID`},force:{type:`boolean`,default:!1,description:`Destroy the socket immediately instead of sending FIN first`},timeoutMs:{type:`number`,default:1e3,description:`Close wait timeout in milliseconds before forcing socket destruction`}},[`sessionId`]),r(`tls_open`,`Open a TLS session.`,{host:{type:`string`,description:`Target host name or IP address`},port:{type:`number`,default:443,description:`Target TLS port`},servername:{type:`string`,description:`Optional SNI and hostname validation override`},alpnProtocols:{type:`array`,items:{type:`string`},description:`Optional ALPN protocols to offer`},timeoutMs:{type:`number`,default:5e3,description:`Connection timeout in milliseconds`},minVersion:{type:`string`,enum:[...n],description:`Optional minimum TLS version`},maxVersion:{type:`string`,enum:[...n],description:`Optional maximum TLS version`},caPem:{type:`string`,description:`Optional PEM-encoded CA bundle`},caPath:{type:`string`,description:`Optional path to a PEM-encoded CA bundle`},allowInvalidCertificates:{type:`boolean`,default:!1,description:`Allow untrusted certificate chains while still reporting the failure`},skipHostnameCheck:{type:`boolean`,default:!1,description:`Skip hostname verification while still reporting the requested target`}},[`host`]),r(`tls_write`,`Write data to an open TLS session.`,{sessionId:{type:`string`,description:`TLS session ID`},dataHex:{type:`string`,description:`Hex-encoded payload to write`},dataText:{type:`string`,description:`UTF-8 text payload to write`},timeoutMs:{type:`number`,default:5e3,description:`Write timeout in milliseconds`}},[`sessionId`]),r(`tls_read_until`,`Read from an open TLS session until a delimiter or byte limit is reached.`,{sessionId:{type:`string`,description:`TLS session ID`},delimiterHex:{type:`string`,description:`Hex-encoded delimiter to stop at`},delimiterText:{type:`string`,description:`UTF-8 delimiter to stop at`},includeDelimiter:{type:`boolean`,default:!0,description:`Include the delimiter bytes in the returned payload`},maxBytes:{type:`number`,description:`Optional maximum number of bytes to return even if no delimiter matches`},timeoutMs:{type:`number`,default:5e3,description:`Read timeout in milliseconds`}},[`sessionId`]),r(`tls_close`,`Close an open TLS session.`,{sessionId:{type:`string`,description:`TLS session ID`},force:{type:`boolean`,default:!1,description:`Destroy the TLS socket immediately instead of sending close_notify/FIN first`},timeoutMs:{type:`number`,default:1e3,description:`Close wait timeout in milliseconds before forcing socket destruction`}},[`sessionId`])],s=[r(`tls_keylog_enable`,`Enable SSLKEYLOGFILE output for TLS library clients.`),r(`tls_keylog_parse`,`Parse an SSLKEYLOGFILE and summarize available key material.`,{path:{type:`string`,description:`Path to SSLKEYLOGFILE`}}),r(`tls_keylog_disable`,`Disable SSLKEYLOGFILE capture and unset the environment variable.`,{path:{type:`string`,description:`Path to disable`}}),r(`tls_decrypt_payload`,`Decrypt a TLS payload using a provided key, nonce, and algorithm.`,{encryptedHex:{type:`string`,description:`Hex-encoded encrypted payload`},keyHex:{type:`string`,description:`Hex-encoded decryption key`},nonceHex:{type:`string`,description:`Hex-encoded nonce/IV`},algorithm:{type:`string`,description:`Cipher algorithm`,default:`aes-256-gcm`},authTagHex:{type:`string`,description:`Hex-encoded authentication tag`}},[`encryptedHex`,`keyHex`,`nonceHex`]),r(`tls_keylog_summarize`,`Summarize an SSLKEYLOGFILE: per-label distribution, secret-type classification (TLS 1.2 master-secret vs TLS 1.3 traffic-secret kinds), TLS version inference, and unique session (client_random) count.`,{content:{type:`string`,description:`Inline keylog content to summarize`},path:{type:`string`,description:`Path to a keylog file to summarize (used when content is not provided)`}}),r(`tls_keylog_lookup_secret`,`Look up a TLS secret by client random hex from the parsed keylog.`,{clientRandom:{type:`string`,description:`Hex-encoded client random`},label:{type:`string`,description:`Optional label filter`}},[`clientRandom`]),r(`tls_cert_pin_bypass`,`Return a certificate pinning bypass strategy for the selected platform.`,{target:{type:`string`,enum:[`android`,`ios`,`desktop`],description:`Target platform for bypass strategy`}},[`target`]),r(`tls_parse_handshake`,`Parse TLS handshake metadata from raw hex. For payload decryption, use tls_decrypt_payload with explicit keyHex/nonceHex/authTagHex.`,{rawHex:{type:`string`,description:`Hex-encoded TLS handshake record`}},[`rawHex`]),r(`tls_cipher_suites`,`List TLS cipher suites with IANA id, protocol, key-exchange / authentication / encryption / MAC split, and AEAD flag (each dimension derived from the suite name).`,{filter:{type:`string`,description:`Keyword filter for cipher suite names (substring match)`},protocol:{type:`string`,enum:[`all`,`1.3`,`1.2`],default:`all`,description:`Filter by TLS protocol version`}}),r(`tls_parse_certificate`,`Parse a TLS Certificate message from raw hex and extract X.509 details (subject/issuer/SAN/validity/keyUsage), SHA-256 fingerprint, and SPKI pin hash (Android Network Security Config / HPKP format).`,{rawHex:{type:`string`,description:`Hex-encoded certificate data`}},[`rawHex`]),r(`tls_probe_endpoint`,`Probe a TLS endpoint and report handshake and certificate details.`,{host:{type:`string`,description:`Target host name or IP address`},port:{type:`number`,default:443,description:`Target TLS port`},servername:{type:`string`,description:`Optional SNI and hostname validation override`},alpnProtocols:{type:`array`,items:{type:`string`},description:`Optional ALPN protocols to offer`},timeoutMs:{type:`number`,default:5e3,description:`Probe timeout in milliseconds`},minVersion:{type:`string`,enum:[...n],description:`Optional minimum TLS version`},maxVersion:{type:`string`,enum:[...n],description:`Optional maximum TLS version`},caPem:{type:`string`,description:`Optional PEM-encoded CA bundle`},caPath:{type:`string`,description:`Optional path to a PEM-encoded CA bundle`},allowInvalidCertificates:{type:`boolean`,default:!1,description:`Allow untrusted certificate chains while still reporting the failure`},skipHostnameCheck:{type:`boolean`,default:!1,description:`Skip hostname verification while still reporting the requested target`}},[`host`])],c=[r(`websocket_open`,`Open a WebSocket session.`,{url:{type:`string`,description:`WebSocket URL`},scheme:{type:`string`,enum:[`ws`,`wss`],default:`ws`,description:`WebSocket transport scheme`},host:{type:`string`,description:`Target host name or IP address`},port:{type:`number`,description:`Target port`},path:{type:`string`,default:`/`,description:`Request path`},subprotocols:{type:`array`,items:{type:`string`},description:`Optional subprotocols to offer`},timeoutMs:{type:`number`,default:5e3,description:`Handshake timeout in milliseconds`},servername:{type:`string`,description:`Optional SNI and hostname validation override`},alpnProtocols:{type:`array`,items:{type:`string`},description:`Optional ALPN protocols to offer`},minVersion:{type:`string`,enum:[...n],description:`Optional minimum TLS version`},maxVersion:{type:`string`,enum:[...n],description:`Optional maximum TLS version`},caPem:{type:`string`,description:`Optional PEM-encoded CA bundle`},caPath:{type:`string`,description:`Optional path to a PEM-encoded CA bundle`},allowInvalidCertificates:{type:`boolean`,default:!1,description:`Allow untrusted certificate chains`},skipHostnameCheck:{type:`boolean`,default:!1,description:`Skip hostname verification`}}),r(`websocket_send_frame`,`Send a WebSocket frame.`,{sessionId:{type:`string`,description:`WebSocket session ID`},frameType:{type:`string`,enum:[`text`,`binary`,`ping`,`pong`,`close`],description:`Outgoing frame opcode`},dataText:{type:`string`,description:`UTF-8 payload for text/ping/pong/close frames`},dataHex:{type:`string`,description:`Hex-encoded payload for binary/ping/pong/close frames`},closeCode:{type:`number`,description:`Optional close status code`},closeReason:{type:`string`,description:`Optional close reason`},timeoutMs:{type:`number`,default:5e3,description:`Write timeout in milliseconds`}},[`sessionId`,`frameType`]),r(`websocket_read_frame`,`Read the next queued WebSocket frame from an open session.`,{sessionId:{type:`string`,description:`WebSocket session ID`},timeoutMs:{type:`number`,default:5e3,description:`Read timeout in milliseconds`}},[`sessionId`]),r(`websocket_close`,`Close an open WebSocket session.`,{sessionId:{type:`string`,description:`WebSocket session ID`},force:{type:`boolean`,default:!1,description:`Destroy the underlying socket immediately without sending a close frame first`},closeCode:{type:`number`,description:`Optional close status code`},closeReason:{type:`string`,description:`Optional close reason`},timeoutMs:{type:`number`,default:1e3,description:`Close wait timeout in milliseconds before forcing socket destruction`}},[`sessionId`])],l=[...s,...o,...c,...i,...a],u=`boringssl-inspector`,d=`boringsslInspectorHandlers`,f=[`workflow`,`full`],p=t({domain:u,depKey:d,lookup:e(l),entries:[{tool:`tls_keylog_enable`,method:`handleTlsKeylogEnableTool`},{tool:`tls_keylog_parse`,method:`handleTlsKeylogParseTool`},{tool:`tls_keylog_disable`,method:`handleTlsKeylogDisableTool`},{tool:`tls_decrypt_payload`,method:`handleTlsDecryptPayloadTool`},{tool:`tls_keylog_summarize`,method:`handleTlsKeylogSummarizeTool`},{tool:`tls_keylog_lookup_secret`,method:`handleTlsKeylogLookupSecretTool`},{tool:`tls_cert_pin_bypass`,method:`handleTlsCertPinBypassTool`},{tool:`tls_parse_handshake`,method:`handleParseHandshakeTool`},{tool:`tls_cipher_suites`,method:`handleCipherSuitesTool`},{tool:`tls_parse_certificate`,method:`handleParseCertificateTool`},{tool:`tls_probe_endpoint`,method:`handleTlsProbeEndpointTool`},{tool:`tcp_open`,method:`handleTcpOpenTool`},{tool:`tcp_write`,method:`handleTcpWriteTool`},{tool:`tcp_read_until`,method:`handleTcpReadUntilTool`},{tool:`tcp_close`,method:`handleTcpCloseTool`},{tool:`tls_open`,method:`handleTlsOpenTool`},{tool:`tls_write`,method:`handleTlsWriteTool`},{tool:`tls_read_until`,method:`handleTlsReadUntilTool`},{tool:`tls_close`,method:`handleTlsCloseTool`},{tool:`websocket_open`,method:`handleWebSocketOpenTool`},{tool:`websocket_send_frame`,method:`handleWebSocketSendFrameTool`},{tool:`websocket_read_frame`,method:`handleWebSocketReadFrameTool`},{tool:`websocket_close`,method:`handleWebSocketCloseTool`},{tool:`tls_cert_pin_bypass_frida`,method:`handleBypassCertPinningTool`},{tool:`net_raw_tcp_send`,method:`handleRawTcpSendTool`},{tool:`net_raw_tcp_listen`,method:`handleRawTcpListenTool`},{tool:`net_raw_udp_send`,method:`handleRawUdpSendTool`},{tool:`net_raw_udp_listen`,method:`handleRawUdpListenTool`}]});async function m(e){let{BoringsslInspectorHandlers:t}=await import(`./handlers-C0I9-BtX.mjs`),{TLSKeyLogExtractor:n}=await import(`./boringssl-inspector-C6M3sOga.mjs`).then(e=>e.t),r=e.getDomainInstance(d);if(r)return r;let i=new t(new n);return i.setExtensionInvoke(async t=>{try{let n=e.getDomainInstance(`binaryInstrumentHandlers`);if(n&&typeof n.handleFridaRunScript==`function`)return n.handleFridaRunScript(t)}catch{}return null}),i.setEventBus(e.eventBus),e.setDomainInstance(d,i),i}const h={kind:`domain-manifest`,version:1,domain:u,depKey:d,profiles:f,registrations:p,ensure:m,workflowRule:{patterns:[/\b(tls|ssl|boringssl|cert(ificate)?|pinning|handshake|keylog|websocket)\b/i,/(tls|ssl|cert|pinning|websocket).*(hook|bypass|intercept|dump|log|frame|session)/i],priority:80,tools:[`tls_probe_endpoint`,`websocket_open`,`websocket_send_frame`,`websocket_read_frame`,`tls_keylog_enable`,`tls_keylog_parse`,`tls_decrypt_payload`,`tls_cert_pin_bypass`],hint:`TLS/WebSocket analysis: probe endpoint → open ws/wss session → exchange frames → inspecttrust/cipher/ALPN → enable keylog or bypass pinning when needed.`},prerequisites:{tls_probe_endpoint:[{condition:`Target scope must be explicitly authorized and routable from the MCP host`,fix:`Verify target authorization, port reachability, and provide servername/custom CA options when needed`}],tls_keylog_enable:[{condition:`Target process must allow SSLKEYLOGFILE or be attachable by Frida`,fix:`Launch the target with SSLKEYLOGFILE env set, or enable Frida-based hooking`}],tls_decrypt_payload:[{condition:`A keylog session must be active with captured secrets`,fix:`Run tls_keylog_enable and reproduce TLS traffic before decrypting`}],tls_cert_pin_bypass_frida:[{condition:`Frida must be available on PATH and attached to the target`,fix:`Install Frida and attach via binary-instrument:frida_attach before running the bypass`}]},toolDependencies:[{from:`network`,to:`boringssl-inspector`,relation:`uses`,weight:.8}]};export{h as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-CJPE5PIl.mjs";const r=`graphql`,i=`graphqlHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`call_graph_analyze`,method:`handleCallGraphAnalyzeTool`},{tool:`script_replace_persist`,method:`handleScriptReplacePersistTool`},{tool:`graphql_introspect`,method:`handleGraphqlIntrospectTool`},{tool:`graphql_extract_queries`,method:`handleGraphqlExtractQueriesTool`},{tool:`graphql_replay`,method:`handleGraphqlReplayTool`},{tool:`graphql_subscribe`,method:`handleGraphqlSubscribeTool`},{tool:`graphql_enum_schema`,method:`handleGraphqlEnumSchemaTool`}]});async function o(e){let{CodeCollector:t,ConsoleMonitor:n}=await import(`./collector-Cld4i-E4.mjs`),{GraphQLToolHandlers:r}=await import(`./graphql-CF7QKJME.mjs`);return e.collector||(e.collector=new t(e.config.puppeteer),e.registerCaches()),e.consoleMonitor||=new n(e.collector),e.graphqlHandlers||=new r({collector:e.collector,consoleMonitor:e.consoleMonitor}),e.graphqlHandlers}const s={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`workflow`,`full`],ensure:o,registrations:a};export{s as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-D3uT-ZbU.mjs";const r=`wasm`,i=`wasmHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`wasm_capabilities`,method:`handleWasmCapabilitiesTool`},{tool:`wasm_dump`,method:`handleWasmDumpTool`},{tool:`wasm_disassemble`,method:`handleWasmDisassembleTool`},{tool:`wasm_decompile`,method:`handleWasmDecompileTool`},{tool:`wasm_inspect_sections`,method:`handleWasmInspectSectionsTool`},{tool:`wasm_offline_run`,method:`handleWasmOfflineRunTool`},{tool:`wasm_optimize`,method:`handleWasmOptimizeTool`},{tool:`wasm_vmp_trace`,method:`handleWasmVmpTraceTool`},{tool:`wasm_memory_inspect`,method:`handleWasmMemoryInspectTool`},{tool:`wasm_to_c`,method:`handleWasmToCTool`},{tool:`wasm_detect_obfuscation`,method:`handleWasmDetectObfuscationTool`},{tool:`wasm_instrument_trace`,method:`handleWasmInstrumentTraceTool`},{tool:`wasm_string_extract`,method:`handleWasmStringExtractTool`},{tool:`wasm_diff`,method:`handleWasmDiffTool`},{tool:`wasm_instrument_binary`,method:`handleWasmInstrumentBinaryTool`},{tool:`wasm_instrument_block`,method:`handleWasmInstrumentBlockTool`},{tool:`wasm_inspect`,method:`handleWasmInspectTool`}]});async function o(e){let{CodeCollector:t}=await import(`./collector-Cld4i-E4.mjs`),{WasmToolHandlers:n}=await import(`./wasm-DX4Qm2Vs.mjs`);return e.collector||(e.collector=new t(e.config.puppeteer),e.registerCaches()),e.wasmHandlers||=new n(e.collector),e.wasmHandlers}const s={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`full`],ensure:o,registrations:a};export{s as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./tool-builder-CpLh-UQd.mjs";const r=[n(`cross_domain_capabilities`,e=>e.desc(`List all cross-domain capability categories and available workflows.`).query()),n(`cross_domain_suggest_workflow`,e=>e.desc(`Recommend a multi-domain workflow to achieve a specific analysis goal.`).string(`goal`,`High-level task goal or problem statement to classify`).boolean(`preferAvailableOnly`,`Prefer workflows whose dependent domains are currently enabled`,{default:!0}).required(`goal`).query()),n(`cross_domain_health`,e=>e.desc(`Report health status of cross-domain bridges and correlators.`).query()),n(`cross_domain_correlate_all`,e=>e.desc(`Run the built-in skia, mojo, syscall, and binary correlators and merge the results into the shared evidence graph.`).boolean(`pullFromDomains`,`When true, fetch missing correlator inputs from live domain buffers using available getter tools`,{default:!1}).number(`minConfidence`,`Minimum edge confidence to include in the returned evidence graph`,{default:0,minimum:0,maximum:1}).number(`maxEdgesPerType`,`Maximum number of returned evidence edges per edge type; 0 means unlimited`,{default:0,minimum:0}).prop(`sceneTree`,{type:`object`,description:`Skia scene tree with layers and drawCommands`,additionalProperties:!0}).array(`jsObjects`,{type:`object`,additionalProperties:!0},`JS object descriptors for Skia correlation`).array(`mojoMessages`,{type:`object`,properties:{interface:{type:`string`},method:{type:`string`},timestamp:{type:`number`},messageId:{type:`string`}},required:[`interface`,`method`,`timestamp`,`messageId`]},`Mojo messages for MOJO-03 correlation`).array(`cdpEvents`,{type:`object`,properties:{eventType:{type:`string`},timestamp:{type:`number`},url:{type:`string`}},required:[`eventType`,`timestamp`]},`CDP events for MOJO-03 correlation`).array(`networkRequests`,{type:`object`,properties:{requestId:{type:`string`},url:{type:`string`},timestamp:{type:`number`}},required:[`requestId`,`url`,`timestamp`]},`Network requests for MOJO-03 correlation`).array(`syscallEvents`,{type:`object`,properties:{pid:{type:`number`},tid:{type:`number`},syscallName:{type:`string`},timestamp:{type:`number`}},required:[`pid`,`tid`,`syscallName`,`timestamp`]},`Syscall events for SYSCALL-02 correlation`).array(`jsStacks`,{type:`object`,properties:{threadId:{type:`number`},timestamp:{type:`number`},frames:{type:`array`,items:{type:`object`,properties:{functionName:{type:`string`}},required:[`functionName`]}}},required:[`threadId`,`timestamp`,`frames`]},`JS stacks for SYSCALL-02 correlation`).prop(`ghidraOutput`,{type:`object`,description:`Binary analysis output with moduleName and functions`,additionalProperties:!0})),n(`cross_domain_evidence_export`,e=>e.desc(`Export the shared cross-domain evidence graph as JSON.`).query()),n(`cross_domain_evidence_query`,e=>e.desc(`Query the shared evidence graph by URL, heap address, function, script, node type, metadata, or chain.`).enum(`queryType`,[`network_url`,`heap_address`,`function`,`script_id`,`node_id`,`node_type`,`metadata`,`chain`],`Evidence query mode`).string(`value`,`Primary query value, such as URL substring, heap address, node ID, or type`).string(`metadataKey`,`Metadata key for queryType=metadata`).string(`metadataValue`,`Optional exact metadata value for queryType=metadata`).enum(`direction`,[`forward`,`backward`],`Traversal direction for queryType=chain`).number(`limit`,`Maximum nodes to return`,{default:50,minimum:1,maximum:500}).required(`queryType`).query()),n(`cross_domain_evidence_stats`,e=>e.desc(`Get node and edge statistics for the shared cross-domain evidence graph.`).query()),n(`cross_domain_synonym`,e=>e.desc(`Map natural-language queries to tool recommendations using a lightweight synonym graph. Pure TS — no LLM. Useful for discovering which tools implement a concept described in plain English (e.g. "find where the app signs requests" → deobfuscation, crypto, network).`).string(`query`,`Natural-language description of the task or concept to find tools for`).number(`maxResults`,`Maximum results to return`,{default:10,minimum:1,maximum:20}).required(`query`).query())],i=`cross-domain`,a=`crossDomainHandlers`,o=t({domain:i,depKey:a,lookup:e(r),entries:[{tool:`cross_domain_capabilities`,method:`handleCapabilitiesTool`},{tool:`cross_domain_suggest_workflow`,method:`handleSuggestWorkflowTool`},{tool:`cross_domain_health`,method:`handleHealthTool`},{tool:`cross_domain_correlate_all`,method:`handleCorrelateAllTool`},{tool:`cross_domain_evidence_export`,method:`handleEvidenceExportTool`},{tool:`cross_domain_evidence_query`,method:`handleEvidenceQueryTool`},{tool:`cross_domain_evidence_stats`,method:`handleEvidenceStatsTool`},{tool:`cross_domain_synonym`,method:`handleSynonymTool`}]});async function s(e){let{ReverseEvidenceGraph:t}=await import(`./ReverseEvidenceGraph-DJzk0GQz.mjs`).then(e=>e.t),{CrossDomainEvidenceBridge:n}=await import(`./evidence-graph-bridge-eT9icP6a.mjs`),{CrossDomainWorkflowClassifier:r,CrossDomainHandlers:i}=await import(`./handlers-Dalu0olz.mjs`),o=e.getDomainInstance(a);if(o)return o;let s=e.getDomainInstance(`evidenceGraph`);s||(s=new t,s.setEventBus(e.eventBus),e.setDomainInstance(`evidenceGraph`,s));let c=e.getDomainInstance(`crossDomainEvidenceBridge`);c||(c=new n(s),e.setDomainInstance(`crossDomainEvidenceBridge`,c));let l=e.getDomainInstance(`crossDomainWorkflowClassifier`);l||(l=new r(e,!0),e.setDomainInstance(`crossDomainWorkflowClassifier`,l));let u=new i(c,l,e);return e.setDomainInstance(a,u),u}const c={kind:`domain-manifest`,version:1,domain:i,depKey:a,profiles:[`full`],ensure:s,workflowRule:{patterns:[/(cross[- ]domain|multi[- ]domain|evidence graph|correlate).*(v8|network|canvas|syscall|mojo|binary)/i,/(跨域|多域|证据图|关联).*(v8|网络|canvas|syscall|mojo|binary)/i],priority:98,tools:[`cross_domain_capabilities`,`cross_domain_suggest_workflow`,`cross_domain_correlate_all`,`cross_domain_evidence_stats`],hint:`Cross-domain reverse workflow: inspect capabilities → suggest mission workflow → correlate evidencefrom all v5.0 domains → export evidence graph`},toolDependencies:[{from:`cross_domain_suggest_workflow`,to:`deobfuscate`,relation:`suggests`,weight:.6},{from:`cross_domain_suggest_workflow`,to:`js_heap_search`,relation:`suggests`,weight:.6},{from:`cross_domain_suggest_workflow`,to:`network_enable`,relation:`suggests`,weight:.5},{from:`cross_domain_suggest_workflow`,to:`canvas_scene_dump`,relation:`suggests`,weight:.5},{from:`cross_domain_suggest_workflow`,to:`skia_correlate_objects`,relation:`suggests`,weight:.5},{from:`cross_domain_suggest_workflow`,to:`syscall_correlate_js`,relation:`suggests`,weight:.5},{from:`cross_domain_suggest_workflow`,to:`ghidra_analyze`,relation:`suggests`,weight:.5},{from:`cross_domain_correlate_all`,to:`evidence_export`,relation:`precedes`,weight:.7}],registrations:o};export{c as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-C-AdFfFu.mjs";const r=`sourcemap`,i=`sourcemapHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`sourcemap_discover`,method:`handleSourcemapDiscoverTool`},{tool:`sourcemap_fetch_and_parse`,method:`handleSourcemapFetchAndParseTool`},{tool:`sourcemap_coverage`,method:`handleSourcemapCoverageTool`},{tool:`sourcemap_lookup`,method:`handleSourcemapLookupTool`},{tool:`sourcemap_reconstruct_tree`,method:`handleSourcemapReconstructTreeTool`},{tool:`sourcemap_parse_v4`,method:`handleSourcemapParseV4Tool`},{tool:`sourcemap_diff`,method:`handleSourcemapDiffTool`}]});async function o(e){let{CodeCollector:t}=await import(`./collector-Cld4i-E4.mjs`),{SourcemapToolHandlers:n}=await import(`./sourcemap-2VIeVeKw.mjs`);return e.collector||(e.collector=new t(e.config.puppeteer),e.registerCaches()),e.sourcemapHandlers||=new n(e.collector),e.sourcemapHandlers}const s={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`full`],ensure:o,registrations:a};export{s as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-DvrYdDCJ2.mjs";const r=`transform`,i=`transformHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`ast_transform_preview`,method:`handleAstTransformPreviewTool`},{tool:`ast_transform_chain`,method:`handleAstTransformChainTool`},{tool:`ast_transform_apply`,method:`handleAstTransformApplyTool`},{tool:`crypto_extract_standalone`,method:`handleCryptoExtractStandaloneTool`},{tool:`crypto_test_harness`,method:`handleCryptoTestHarnessTool`},{tool:`crypto_compare`,method:`handleCryptoCompareTool`},{tool:`transform_workbench`,method:`handleTransformWorkbenchTool`}]});async function o(e){let{CodeCollector:t}=await import(`./collector-Cld4i-E4.mjs`),{TransformToolHandlers:n}=await import(`./transform-BJqsBC_-.mjs`);return e.collector||(e.collector=new t(e.config.puppeteer),e.registerCaches()),e.transformHandlers||=new n(e.collector),e.transformHandlers}const s={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`full`],ensure:o,registrations:a};export{s as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-BvolWeSu.mjs";const r=`platform`,i=`platformHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`platform_capabilities`,method:`handlePlatformCapabilitiesTool`},{tool:`miniapp_pkg_scan`,method:`handleMiniappPkgScanTool`},{tool:`miniapp_pkg_unpack`,method:`handleMiniappPkgUnpackTool`},{tool:`miniapp_pkg_analyze`,method:`handleMiniappPkgAnalyzeTool`},{tool:`asar_extract`,method:`handleAsarExtractTool`},{tool:`electron_inspect_app`,method:`handleElectronInspectAppTool`},{tool:`electron_scan_userdata`,method:`handleElectronScanUserdataTool`},{tool:`asar_search`,method:`handleAsarSearchTool`},{tool:`electron_check_fuses`,method:`handleElectronCheckFusesTool`},{tool:`electron_patch_fuses`,method:`handleElectronPatchFusesTool`},{tool:`v8_bytecode_decompile`,method:`handleV8BytecodeDecompileTool`},{tool:`electron_launch_debug`,method:`handleElectronLaunchDebugTool`},{tool:`electron_debug_status`,method:`handleElectronDebugStatusTool`},{tool:`electron_ipc_sniff`,method:`handleElectronIPCSniffTool`},{tool:`electron_verify_integrity`,method:`handleElectronVerifyIntegrityTool`},{tool:`asar_deobfuscate`,method:`handleAsarDeobfuscateTool`},{tool:`asar_repack`,method:`handleAsarRepackTool`},{tool:`electron_verify_signature`,method:`handleElectronVerifySignatureTool`}]});async function o(e){let{CodeCollector:t}=await import(`./collector-Cld4i-E4.mjs`),{PlatformToolHandlers:n}=await import(`./platform-BIXgJaM3.mjs`);return e.collector||(e.collector=new t(e.config.puppeteer),e.registerCaches()),e.platformHandlers||=new n(e.collector),e.platformHandlers}const s={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`full`],ensure:o,registrations:a};export{s as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ensure-browser-core-BP70x0TB.mjs";import{t}from"./registry-DJDnkQW2.mjs";import{n}from"./bind-helpers-D0mGAOof.mjs";import{t as r}from"./tool-builder-CpLh-UQd.mjs";import{n as i,t as a}from"./definitions-0mtilYzG.mjs";import{t as o}from"./authorization-schema-Jtikc5Yt.mjs";import{resolve as s}from"node:path";const c=[`before-load-inject`,`runtime-hook`,`network-intercept`,`function-trace`,`storage-mutation`,`dom-observation`],l=[r(`instrumentation_session`,e=>e.desc(`Start, stop, or query status of an instrumentation recording session.`).enum(`action`,[`create`,`list`,`destroy`,`status`],`Session operation`).string(`name`,`Optional session name for create`).string(`sessionId`,`Session ID (required for destroy/status)`).required(`action`)),r(`instrumentation_session_export`,e=>e.desc(`Export an instrumentation session snapshot to an artifacts JSON file.`).string(`sessionId`,`Session ID to export`).string(`outputDir`,`Optional project-relative output directory under the workspace`).required(`sessionId`)),r(`instrumentation_session_diff`,e=>e.desc(`Diff two instrumentation session snapshots: operations added/removed/common (by id) plus artifact fingerprints and per-type counts. Pure compare, mutates nothing.`).string(`sessionIdA`,`Baseline session ID`).string(`sessionIdB`,`Compared session ID`).required(`sessionIdA`,`sessionIdB`).query()),r(`instrumentation_session_merge`,e=>e.desc(`Merge two sessions into a new session: copies operations (with id remapping) and artifacts from both sources. Original sessions are untouched.`).string(`sessionIdA`,`First source session ID`).string(`sessionIdB`,`Second source session ID`).string(`name`,`Optional name for the merged session`).required(`sessionIdA`,`sessionIdB`)),r(`instrumentation_operation`,e=>e.desc(`Manage operations inside an instrumentation session.`).enum(`action`,[`register`,`list`,`status`,`stop`],`Operation`).string(`sessionId`,`Session ID`).string(`operationId`,`Operation ID for status or stop`).enum(`type`,c,`Instrumentation type (action=register)`).string(`target`,`Function name, URL pattern, or script target (action=register)`).object(`config`,{},`Operation-specific config (action=register)`).required(`action`,`sessionId`)),r(`instrumentation_artifact`,e=>e.desc(`Manage artifacts captured by instrumentation operations.`).enum(`action`,[`record`,`query`],`Artifact operation`).string(`sessionId`,`Session ID`).string(`operationId`,`Operation ID (action=record)`).object(`data`,{},`Captured artifact payload (action=record)`).enum(`type`,c,`Optional artifact type filter (action=query)`).number(`limit`,`Max artifacts to return (action=query, default: 50)`,{default:50,minimum:1,maximum:500}).required(`action`,`sessionId`)),r(`instrumentation_hook_preset`,e=>e.desc(`Apply hook presets inside an instrumentation session.`).string(`sessionId`,`Session ID`).string(`preset`,`Single preset id to inject`).array(`presets`,{type:`string`},`Multiple preset ids to inject in one call`).boolean(`captureStack`,`Whether injected presets should capture stack traces`,{default:!1}).boolean(`logToConsole`,`Whether injected presets should log to console`,{default:!0}).enum(`method`,[`evaluate`,`evaluateOnNewDocument`],`Injection method forwarded to hook_preset`,{default:`evaluate`}).prop(`customTemplate`,{type:`object`,additionalProperties:!0,description:`Optional inline custom preset definition`}).prop(`customTemplates`,{type:`array`,items:{type:`object`,additionalProperties:!0},description:`Optional inline custom preset definitions`}).requiredOpenWorld(`sessionId`)),r(`instrumentation_network_replay`,e=>e.desc(`Replay a captured network request inside an instrumentation session.`).string(`sessionId`,`Session ID`).string(`requestId`,`Captured request ID returned by network_get_requests`).object(`headerPatch`,{additionalProperties:{type:`string`}},`Optional request header overrides`).string(`bodyPatch`,`Optional raw request body override`).string(`methodOverride`,`Optional HTTP method override`).string(`urlOverride`,`Optional destination URL override`).object(`authorization`,o,`Optional request-scoped authorization for private-network or insecure-HTTP replay.`).string(`authorizationCapability`,`Optional base64url-encoded request-scoped authorization capability.`).number(`timeoutMs`,`Optional replay timeout in milliseconds`).boolean(`dryRun`,`Preview the replay without sending the request`,{default:!0}).requiredOpenWorld(`sessionId`,`requestId`))];r(`ai_hook`,e=>e.desc(`Manage AI hooks. Actions: inject (inject code into page), get_data (retrieve captured hook data), list (all active hooks), clear (remove hook data by id or all), toggle (enable/disable a hook), export (export data as JSON/CSV).`).enum(`action`,[`inject`,`get_data`,`list`,`clear`,`toggle`,`export`],`Operation to perform`).string(`hookId`,`Hook identifier (required for inject/get_data/toggle; optional for clear/export)`).string(`code`,`Hook code to inject (required for action=inject)`).enum(`method`,[`evaluateOnNewDocument`,`evaluate`],`Injection method (for action=inject)`,{default:`evaluate`}).boolean(`enabled`,`Enable or disable hook (required for action=toggle)`).enum(`format`,[`json`,`csv`],`Export format (for action=export)`,{default:`json`}).required(`action`)),r(`hook_preset`,e=>e.desc(`Install a pre-built JavaScript hook from 20+ built-in presets (eval, atob/btoa, Proxy, Reflect, Object.defineProperty, etc.), or provide customTemplate/customTemplates to install your own reusable hook bodies. Use listPresets=true to see all available preset descriptions.`).string(`preset`,`Single preset name to install. Accepts built-in preset ids or ids provided by customTemplate/customTemplates.`).array(`presets`,{type:`string`},`List of preset names to install simultaneously. Accepts built-in ids and custom template ids.`).prop(`customTemplate`,{type:`object`,properties:{id:{type:`string`,description:`Stable preset id, for example deobfuscation-sinks`},description:{type:`string`,description:`Human-readable description for listPresets output.`},body:{type:`string`,description:`Hook body snippet inserted into the preset wrapper.`}},required:[`id`,`body`],description:`Inline custom template. body should contain the hook body inserted into the standard buildHookCode wrapper. Use {{STACK_CODE}} and {{LOG_FN}} placeholders when needed.`}).prop(`customTemplates`,{type:`array`,items:{type:`object`,properties:{id:{type:`string`},description:{type:`string`},body:{type:`string`}},required:[`id`,`body`]},description:`List of inline custom templates to register for this invocation.`}).boolean(`captureStack`,`Include call stack in captured data (has performance impact)`,{default:!1}).boolean(`logToConsole`,`Log hook events to browser console`,{default:!0}).enum(`method`,[`evaluate`,`evaluateOnNewDocument`],`Injection method: evaluate=current page, evaluateOnNewDocument=before page scripts`,{default:`evaluate`}).boolean(`listPresets`,`Set to true to list all available presets with descriptions instead of installing.`,{default:!1})),r(`evidence_query`,e=>e.desc(`Query reverse evidence graph by URL, function name, or script ID to find associated nodes.`).enum(`by`,[`url`,`function`,`script`],`Query dimension`).string(`value`,`Search value: URL/fragment, function name, or script ID`).required(`by`,`value`).query()),r(`evidence_export`,e=>e.desc(`Export the reverse evidence graph as JSON snapshot or Markdown report.`).enum(`format`,[`json`,`markdown`],`Export format`).required(`format`).query()),r(`evidence_chain`,e=>e.desc(`Get full provenance chain from a node ID in specified direction.`).string(`nodeId`,`Evidence node ID to start from`).enum(`direction`,[`forward`,`backward`],`Traversal direction`,{default:`forward`}).required(`nodeId`).query());const u=[r(`evidence_query`,e=>e.desc(`Query reverse evidence graph by URL, function name, or script ID to find associated nodes.`).enum(`by`,[`url`,`function`,`script`],`Query dimension`).string(`value`,`Search value: URL/fragment, function name, or script ID`).required(`by`,`value`).query()),r(`evidence_export`,e=>e.desc(`Export the reverse evidence graph as JSON snapshot or Markdown report.`).enum(`format`,[`json`,`markdown`],`Export format`).required(`format`).query()),r(`evidence_chain`,e=>e.desc(`Get full provenance chain from a node ID in specified direction.`).string(`nodeId`,`Evidence node ID to start from`).enum(`direction`,[`forward`,`backward`],`Traversal direction`,{default:`forward`}).required(`nodeId`).query())],d=`instrumentation`,f=`instrumentationHandlers`,p=t([...l,...a,...i,...u]),m=n({domain:d,depKey:f,lookup:p,entries:[{tool:`instrumentation_session`,method:`handleSessionDispatch`},{tool:`instrumentation_session_export`,method:`handleSessionExport`},{tool:`instrumentation_session_diff`,method:`handleSessionDiff`},{tool:`instrumentation_session_merge`,method:`handleSessionMerge`},{tool:`instrumentation_operation`,method:`handleOperationDispatch`},{tool:`instrumentation_artifact`,method:`handleArtifactDispatch`},{tool:`instrumentation_hook_preset`,method:`handleHookPreset`},{tool:`instrumentation_network_replay`,method:`handleNetworkReplay`}]}),h=n({domain:d,depKey:`aiHookHandlers`,lookup:p,entries:[{tool:`ai_hook`,method:`handleAIHook`}]}),g=n({domain:d,depKey:`hookPresetHandlers`,lookup:p,entries:[{tool:`hook_preset`,method:`handleHookPreset`}]}),_=n({domain:d,depKey:`evidenceHandlers`,lookup:p,entries:[{tool:`evidence_query`,method:`handleQueryDispatch`},{tool:`evidence_export`,method:`handleExportDispatch`},{tool:`evidence_chain`,method:`handleChain`}]});async function v(t){let{ReverseEvidenceGraph:n}=await import(`./ReverseEvidenceGraph-DJzk0GQz.mjs`).then(e=>e.t),{InstrumentationSessionManager:r}=await import(`./InstrumentationSession-Cv1wikLA.mjs`),{EvidenceGraphBridge:i}=await import(`./EvidenceGraphBridge-DBDc0wUA.mjs`),{InstrumentationHandlers:a}=await import(`./handlers--qCl9vNv.mjs`);if(await e(t),!t.aiHookHandlers){let{AIHookToolHandlers:e}=await import(`./hooks-COK3t5rT.mjs`);t.aiHookHandlers=new e(t.pageController)}if(!t.hookPresetHandlers){let{HookPresetToolHandlers:e}=await import(`./hooks-COK3t5rT.mjs`);t.hookPresetHandlers=new e(t.pageController)}let o=t.getDomainInstance(`evidenceGraph`);o||(o=new n,o.setEventBus(t.eventBus),t.setDomainInstance(`evidenceGraph`,o));let c=t.getDomainInstance(`evidenceGraphBridge`);if(c||(c=new i(o),t.setDomainInstance(`evidenceGraphBridge`,c)),!t.evidenceHandlers){let{EvidenceHandlers:e}=await import(`./handlers-DASJI0Pn.mjs`);t.evidenceHandlers=new e(o)}let l=t.getDomainInstance(`snapshotScheduler`),u=t.getDomainInstance(`snapshotStateDir`);o.setPersistNotifier(l?()=>l.notifyDirty():void 0),l&&u&&!t.getDomainInstance(`evidenceGraphSnapshotRegistered`)&&(l.register(s(u,`evidence-graph`,`current.json`),o),t.setDomainInstance(`evidenceGraphSnapshotRegistered`,!0));let d=t.getDomainInstance(`instrumentationSessionManager`);d||(d=new r,t.setDomainInstance(`instrumentationSessionManager`,d)),d.setEvidenceBridge(c);let f=t.handlerDeps.hookPresetHandlers,p=t.handlerDeps.advancedHandlers;return t.instrumentationHandlers||=new a(d,{hookPresetHandlers:f,advancedHandlers:p}),t.instrumentationHandlers}const y={kind:`domain-manifest`,version:1,domain:d,depKey:f,secondaryDepKeys:[`aiHookHandlers`,`hookPresetHandlers`,`evidenceHandlers`],profiles:[`full`],ensure:v,workflowRule:{patterns:[/(hook|intercept|trace|instrument).*(session|unified|manage|all)/i,/(session|统一|会话).*(hook|拦截|追踪|仪器化|instrument)/i,/(evidence|provenance|chain).*(graph|query|export|report)/i,/(证据|溯源|链).*(图|查询|导出|报告)/i],priority:95,tools:[`instrumentation_session`,`instrumentation_session_export`,`instrumentation_session_diff`,`instrumentation_session_merge`,`instrumentation_operation`,`instrumentation_artifact`,`instrumentation_hook_preset`,`instrumentation_network_replay`,`ai_hook`,`hook_preset`,`evidence_query`,`evidence_export`,`evidence_chain`],hint:`Instrumentation session: create session → attach hook presets / network replay → record artifacts → query artifacts → destroy when done. Also: AI hook injection, hook presets, evidence graph query/export/chain.`},registrations:[...m,...h,...g,..._]};export{y as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./tool-builder-CpLh-UQd.mjs";const r=[n(`native_bridge_status`,e=>e.desc(`Check native bridge backend health.`).enum(`backend`,[`ghidra`,`ida`,`rizin`,`binaryninja`,`all`],`Which backend to check`,{default:`all`}).string(`ghidraEndpoint`,`Ghidra bridge server URL`,{default:`http://127.0.0.1:18080`}).string(`idaEndpoint`,`IDA bridge server URL`,{default:`http://127.0.0.1:18081`}).string(`rizinEndpoint`,`Rizin bridge server URL`,{default:`http://127.0.0.1:18082`}).string(`binaryNinjaEndpoint`,`Binary Ninja bridge server URL`,{default:`http://127.0.0.1:18083`}).query()),n(`ghidra_bridge`,e=>e.desc(`Send a command to a Ghidra headless analysis bridge.`).enum(`action`,[`status`,`open_project`,`list_functions`,`decompile_function`,`run_script`,`get_xrefs`,`search_strings`,`get_segments`],`Action to perform`).string(`binaryPath`,`Path to binary file (for open_project)`).string(`functionName`,`Function name or address (for decompile_function, get_xrefs)`).string(`scriptPath`,`Path to Ghidra script (for run_script)`).array(`scriptArgs`,{type:`string`},`Arguments for the script`).string(`searchPattern`,`String pattern to search (for search_strings)`).string(`endpoint`,`Ghidra bridge server URL`).required(`action`)),n(`ida_bridge`,e=>e.desc(`Send a command to an IDA Pro plugin bridge.`).enum(`action`,[`status`,`open_binary`,`list_functions`,`decompile_function`,`run_script`,`get_xrefs`,`search_strings`,`get_strings`,`get_segments`],`Action to perform`).string(`binaryPath`,`Path to binary file (for open_binary)`).string(`functionName`,`Function name or address (for decompile_function, get_xrefs)`).string(`scriptPath`,`Path to IDAPython script (for run_script)`).array(`scriptArgs`,{type:`string`},`Arguments for the script`).string(`searchPattern`,`String pattern to search (for search_strings)`).string(`endpoint`,`IDA bridge server URL`).required(`action`)),n(`rizin_bridge`,e=>e.desc(`Send a command to a local Rizin/r2 analysis bridge.`).enum(`action`,[`status`,`open_binary`,`analyze`,`list_functions`,`disassemble_function`,`run_command`,`get_xrefs`,`search_strings`,`get_segments`],`Action to perform`).string(`binaryPath`,`Path to binary file (for open_binary)`).string(`functionName`,`Function name or address (for disassemble_function, get_xrefs)`).string(`command`,`Rizin/r2 command to execute (for run_command)`).string(`analysisLevel`,`Analysis level or preset (for analyze)`).string(`searchPattern`,`String pattern to search (for search_strings)`).string(`endpoint`,`Rizin bridge server URL`).required(`action`)),n(`binary_ninja_bridge`,e=>e.desc(`Send a command to a local Binary Ninja analysis bridge.`).enum(`action`,[`status`,`open_binary`,`list_functions`,`decompile_function`,`disassemble_function`,`run_script`,`get_xrefs`,`search_strings`,`get_strings`,`get_segments`,`get_types`],`Action to perform`).string(`binaryPath`,`Path to binary file (for open_binary)`).string(`functionName`,`Function name or address (for decompile_function, disassemble_function, get_xrefs)`).string(`scriptPath`,`Path to Binary Ninja Python script (for run_script)`).array(`scriptArgs`,{type:`string`},`Arguments for the script`).string(`searchPattern`,`String pattern to search (for search_strings)`).string(`endpoint`,`Binary Ninja bridge server URL`).required(`action`)),n(`native_symbol_sync`,e=>e.desc(`Export native symbols to connected analysis backends. Supports json/csv/idc/sqlite output; an optional sinceHash requests an incremental export (only changed symbols) from backends that support it.`).enum(`source`,[`ghidra`,`ida`,`rizin`,`binaryninja`],`Which tool to export symbols from`).string(`filter`,`Regex pattern to filter symbol names`).enum(`exportFormat`,[`json`,`csv`,`idc`,`sqlite`],`Output format`,{default:`json`}).string(`sinceHash`,`Optional content hash from a previous sync. When the backend supports incremental export, only symbols changed since this hash are returned; unsupported backends return the full set.`).string(`endpoint`,`Bridge server URL`).required(`source`))],i=`native-bridge`,a=`nativeBridgeHandlers`,o=t({domain:i,depKey:a,lookup:e(r),entries:[{tool:`native_bridge_status`,method:`handleNativeBridgeStatusTool`},{tool:`ghidra_bridge`,method:`handleGhidraBridgeTool`},{tool:`ida_bridge`,method:`handleIdaBridgeTool`},{tool:`rizin_bridge`,method:`handleRizinBridgeTool`},{tool:`binary_ninja_bridge`,method:`handleBinaryNinjaBridgeTool`},{tool:`native_symbol_sync`,method:`handleNativeSymbolSyncTool`}]});async function s(e){let{NativeBridgeHandlers:t}=await import(`./native-bridge-Dzd7hYoq.mjs`),n=e.getDomainInstance(a);if(n)return n;let r=new t;return e.setDomainInstance(a,r),r}const c={kind:`domain-manifest`,version:1,domain:i,depKey:a,profiles:[`full`],registrations:o,ensure:s,workflowRule:{patterns:[/\b(native\s?bridge|ghidra|ida|rizin|radare2|r2|binary\s?ninja|decompiler)\b/i,/(native|binary).*(decompile|disassemble|xref|segment|symbol|function)/i],priority:76,tools:[`native_bridge_status`,`ghidra_bridge`,`ida_bridge`,`rizin_bridge`,`binary_ninja_bridge`,`native_symbol_sync`],hint:`Native bridge: check local bridge health, open binaries, decompile/disassemble, sync symbols.`},prerequisites:{native_bridge_status:[{condition:`Bridge server endpoints must be local loopback HTTP(S) services`,fix:`Start the desired bridge on 127.0.0.1/localhost or use the constructor defaults`}],ghidra_bridge:[{condition:`Ghidra bridge server must be running`,fix:`Start ghidra_bridge on http://127.0.0.1:18080`}],ida_bridge:[{condition:`IDA bridge server must be running`,fix:`Start the IDA bridge plugin on http://127.0.0.1:18081`}],rizin_bridge:[{condition:`Rizin bridge server must be running`,fix:`Start a local rizin/r2 HTTP bridge on http://127.0.0.1:18082`}],binary_ninja_bridge:[{condition:`Binary Ninja bridge server must be running`,fix:`Start a local Binary Ninja bridge plugin on http://127.0.0.1:18083`}]},toolDependencies:[{from:`native_symbol_sync`,to:`native_bridge_status`,relation:`requires`,weight:.7},{from:`ghidra_bridge`,to:`native_bridge_status`,relation:`suggests`,weight:.5},{from:`ida_bridge`,to:`native_bridge_status`,relation:`suggests`,weight:.5},{from:`rizin_bridge`,to:`native_bridge_status`,relation:`suggests`,weight:.5},{from:`binary_ninja_bridge`,to:`native_bridge_status`,relation:`suggests`,weight:.5}]};export{c as default,r as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./tool-builder-CpLh-UQd.mjs";const r=[n(`nemu_capabilities`,e=>e.desc(`Report native-emulator backend availability, supported features, and explicit ISA/SIMD gaps. Unsupported opcodes fail loudly instead of being reported as emulated.`).query()),n(`nemu_create_session`,e=>e.desc(`Create an isolated ARM64 emulator session and return its sessionId. Each session owns its own CPU registers, guest stack, and JNI object table, so concurrent analyses never interfere. Destroy it with nemu_destroy_session when done; idle sessions auto-expire.`).boolean(`installSyscalls`,`Install the default Android syscall table (default: true)`,{default:!0})),n(`nemu_destroy_session`,e=>e.desc(`Destroy an emulator session and free its memory (mapped library, stack, JNI tables).`).string(`sessionId`,`Session id returned by nemu_create_session`).required(`sessionId`).resettable()),n(`nemu_list_sessions`,e=>e.desc(`List active emulator sessions with their creation and last-use timestamps.`).query()),n(`nemu_session_info`,e=>e.desc(`Inspect one emulator session without executing native code. Returns timestamps, exported symbols, unresolved imports, constructor faults, and active session count.`).string(`sessionId`,`Session id returned by nemu_create_session`).required(`sessionId`).query()),n(`nemu_load_library`,e=>e.desc(`Load an AArch64 ELF shared object (.so) from a filesystem path into a session, mapping its segments and resolving exported symbols. Prerequisite for list_symbols / call_symbol / call_jni_export.`).string(`sessionId`,`Session id returned by nemu_create_session`).string(`soPath`,`Filesystem path to the .so library`).required(`sessionId`,`soPath`)),n(`nemu_load_library_chain`,e=>e.desc(`Load a chain of dependent libraries into a session, resolving inter-library imports. Pass dependency .so paths as dependencyPaths (loaded first in order), then the primary .so path. Each dependency exports are visible to the primary and later dependencies. Use this for FFmpeg-style multi-library loads where libijkplayer.so calls exports from libijkffmpeg.so and libijksdl.so.`).string(`sessionId`,`Session identifier`).array(`dependencyPaths`,{type:`string`},`Filesystem paths to dependency .so files (loaded in order)`).string(`primaryPath`,`Filesystem path to the primary .so library`).required(`sessionId`,`dependencyPaths`,`primaryPath`)),n(`nemu_inspect_imports`,e=>e.desc(`Inspect an AArch64 ELF .so before emulation and list imported symbols from dynamic relocations, including GOT offsets and whether each import is backed by the built-in bionic stubs. Use this to diagnose PLT/GOT NULL indirect-call failures without writing ad-hoc readelf/Capstone scripts.`).string(`soPath`,`Filesystem path to the .so library`).required(`soPath`).query()),n(`nemu_extract_apk_libs`,e=>e.desc(`List the loadable arm64-v8a native libraries (.so) packaged inside an APK, with their byte sizes. Use nemu_load_apk_library to load one. Note: libapp.so (Flutter Dart AOT) is listed but is not executable here — route it to the Dart layer.`).string(`apkPath`,`Filesystem path to the APK file`).required(`apkPath`).query()),n(`nemu_load_apk_library`,e=>e.desc(`Extract a specific arm64-v8a .so from an APK by name and load it into a session in one step (no temp files). Pair with nemu_extract_apk_libs to discover library names.`).string(`sessionId`,`Session id returned by nemu_create_session`).string(`apkPath`,`Filesystem path to the APK file`).string(`libName`,`Library basename to load, e.g. "libnative-lib.so"`).required(`sessionId`,`apkPath`,`libName`)),n(`nemu_list_symbols`,e=>e.desc(`List the exported function symbols of the loaded library — the names callable via call_symbol / call_jni_export.`).string(`sessionId`,`Session id with a library already loaded`).required(`sessionId`).query()),n(`nemu_call_symbol`,e=>e.desc("Invoke an exported function by name following AArch64 AAPCS (integer args in x0..x7, result in x0). For plain native exports; use call_jni_export for `Java_*` JNI entry points.").string(`sessionId`,`Session id with a library already loaded`).string(`symbol`,`Exported symbol name to call`).array(`args`,{type:`number`},`Integer arguments passed in x0..x7 (default: none)`).required(`sessionId`,`symbol`)),n(`nemu_call_jni_export`,e=>e.desc("Invoke an exported `Java_*` JNI function. Injects the guest `JNIEnv*` and thiz, then the Java arguments. Returns x0 — an int/jboolean directly, or a jobject/jbyteArray/jstring handle to resolve via read_byte_array. The main entry point for reversing a native signing/crypto routine.").string(`sessionId`,`Session id with a library already loaded`).string(`symbol`,"Exported `Java_*` JNI function name").array(`javaArgs`,{type:`number`},`Java arguments (ints or jobject handles) after thiz`).number(`thiz`,`Receiver handle (jobject/jclass); 0 for static/none`,{default:0}).required(`sessionId`,`symbol`)),n(`nemu_setup_java_mock`,e=>e.desc("Register a mock Java method the emulated native code can call back into via JNI (GetMethodID/GetStaticMethodID + `Call*Method`). Declaratively specify the return value with returnInt, returnString, or returnBytes (base64) — emulating the 'Java world' a native routine reads from before computing its result. No code is executed; only the configured constant is returned.").string(`sessionId`,`Session id for the mock registration`).string(`className`,`Java class name, e.g. "com/app/Config"`).string(`methodName`,`Method name the native code looks up`).string(`signature`,`JNI method signature, e.g. "()I" or "(I)[B"`).number(`returnInt`,`Constant int/jboolean to return (mutually exclusive)`).string(`returnString`,`Constant string to return as a jstring handle (mutually exclusive)`).string(`returnBytes`,`Constant base64 bytes to return as a jbyteArray handle (exclusive)`).required(`sessionId`,`className`,`methodName`,`signature`)),n(`nemu_setup_java_field`,e=>e.desc(`Register a mock Java field the emulated native code reads back via JNI (GetFieldID/GetStaticFieldID + Get<Type>Field). Declaratively specify the value with valueInt, valueString, or valueBytes (base64) — the 'Java world' constant a native routine folds into its result. No code is executed.`).string(`sessionId`,`Session id for the mock registration`).string(`className`,`Java class name, e.g. "com/app/Config"`).string(`fieldName`,`Field name the native code looks up`).string(`signature`,`JNI field signature, e.g. "I", "J", or "Ljava/lang/String;"`).number(`valueInt`,`Constant int/long/boolean value (mutually exclusive)`).string(`valueString`,`Constant string returned as a jstring handle (mutually exclusive)`).string(`valueBytes`,`Constant base64 bytes returned as a jbyteArray handle (exclusive)`).required(`sessionId`,`className`,`fieldName`,`signature`)),n(`nemu_new_byte_array`,e=>e.desc(`Wrap base64 bytes as a JNI jbyteArray handle to pass as an argument into call_jni_export (e.g. the plaintext a signing routine consumes). Returns the handle.`).string(`sessionId`,`Session id to allocate the handle in`).string(`dataBase64`,`Byte payload as a base64 string`).required(`sessionId`,`dataBase64`)),n(`nemu_read_byte_array`,e=>e.desc(`Resolve a jbyteArray handle (e.g. a native call's return value) back to its bytes, returned as base64 plus length.`).string(`sessionId`,`Session id owning the handle`).number(`handle`,`jbyteArray handle returned by a native call or new_byte_array`).required(`sessionId`,`handle`).query()),n(`nemu_trace`,e=>e.desc(`Invoke an exported symbol while recording every instruction executed (pc, opcode, step), optionally snapshotting named registers per step. Bounded by maxSteps. Use to follow the control flow / algorithm of an obfuscated native function.`).string(`sessionId`,`Session id with a library already loaded`).string(`symbol`,`Exported symbol name to execute under trace`).array(`args`,{type:`number`},`Integer arguments passed in x0..x7 (default: none)`).array(`captureRegisters`,{type:`string`},`Register names to snapshot each step. GPR aliases: x0..x30, sp, pc. SIMD/FP vector aliases: v0..v31 (full 128-bit), or qN/dN/sN/hN/bN for the narrower width. Default: none.`).number(`maxSteps`,`Maximum trace events to return (default: 1000)`,{default:1e3}).boolean(`persistArtifact`,`When true, write the full trace JSON to artifacts/traces and return traceArtifact metadata`,{default:!1}).number(`traceInlineLimit`,`Maximum number of trace rows to include inline in the MCP response; the artifact still contains the full captured trace`).required(`sessionId`,`symbol`)),n(`nemu_disassemble`,e=>e.desc(`Disassemble a single instruction without creating an emulator session. Supports arm64/aarch64, x86, x64, riscv32/riscv64, mips/mips32, and mipsel. This is a local lightweight decoder for trace readability, including common SSE/AVX/AVX2/AVX-512 EVEX, RISC-V, and MIPS instructions.`).enum(`architecture`,[`arm64`,`aarch64`,`x86`,`x64`,`riscv32`,`riscv64`,`mips`,`mips32`,`mipsel`],`Instruction architecture / ISA mode`,{default:`arm64`}).prop(`opcode`,{anyOf:[{type:`string`},{type:`number`}],description:`Instruction opcode as a number, a 0x-prefixed hex string, or hex bytes separated by spaces (e.g. "62 f1 74 48 58 c2").`}).string(`pc`,`Program counter used for relative target formatting, as decimal or 0x hex`,{default:`0x0`}).required(`architecture`,`opcode`).query()),n(`nemu_alloc_memory`,e=>e.desc(`Allocate raw guest memory (NOT a JNI handle — a real char* address). Optionally fill with initial data via fillBytes (base64). Returns the guest address to pass as an integer arg to call_symbol. Use at the start of a session to stage encrypted blobs for a native decrypt/signing routine, then read the output with nemu_read_memory.`).string(`sessionId`,`Session id to allocate in`).number(`size`,`Number of bytes to allocate (rounded up to 4 KB pages)`).string(`fillBytes`,`Optional base64 data to write at the start of the region`).number(`maxBytes`,`Optional per-call cap, bounded by server configuration.`).required(`sessionId`,`size`)),n(`nemu_read_memory`,e=>e.desc(`Read raw bytes from guest memory at a given address. Returns a bounded preview by default; set includeDataBase64=true for full base64 within the configured cap.`).string(`sessionId`,`Session id to read from`).number(`address`,`Guest address to read from`).number(`length`,`Number of bytes to read`).number(`previewBytes`,`Number of bytes to include in previewBase64.`).number(`maxBytes`,`Optional per-call cap, bounded by server configuration.`).boolean(`includeDataBase64`,`Include full base64 bytes when true.`,{default:!1}).required(`sessionId`,`address`,`length`).query()),n(`nemu_write_memory`,e=>e.desc(`Write raw bytes into guest memory at a given address via base64 data. Use to update an input buffer between call_symbol invocations without re-allocating, or to patch code/data in place.`).string(`sessionId`,`Session id to write to`).number(`address`,`Guest address to write to`).string(`dataBase64`,`Data to write as a base64 string`).number(`maxBytes`,`Optional per-call cap, bounded by server configuration.`).required(`sessionId`,`address`,`dataBase64`))],i=`native-emulator`,a=`nativeEmulatorHandlers`,o=t({domain:i,depKey:a,lookup:e(r),entries:[{tool:`nemu_capabilities`,method:`handleCapabilities`},{tool:`nemu_create_session`,method:`handleCreateSession`},{tool:`nemu_destroy_session`,method:`handleDestroySession`},{tool:`nemu_list_sessions`,method:`handleListSessions`},{tool:`nemu_session_info`,method:`handleSessionInfo`},{tool:`nemu_load_library`,method:`handleLoadLibrary`},{tool:`nemu_load_library_chain`,method:`handleLoadLibraryChain`},{tool:`nemu_inspect_imports`,method:`handleInspectImports`},{tool:`nemu_extract_apk_libs`,method:`handleExtractApkLibs`},{tool:`nemu_load_apk_library`,method:`handleLoadApkLibrary`},{tool:`nemu_list_symbols`,method:`handleListSymbols`},{tool:`nemu_call_symbol`,method:`handleCallSymbol`},{tool:`nemu_call_jni_export`,method:`handleCallJniExport`},{tool:`nemu_setup_java_mock`,method:`handleSetupJavaMock`},{tool:`nemu_setup_java_field`,method:`handleSetupJavaField`},{tool:`nemu_new_byte_array`,method:`handleNewByteArray`},{tool:`nemu_read_byte_array`,method:`handleReadByteArray`},{tool:`nemu_trace`,method:`handleTrace`},{tool:`nemu_disassemble`,method:`handleDisassemble`},{tool:`nemu_alloc_memory`,method:`handleAllocMemory`},{tool:`nemu_read_memory`,method:`handleReadMemory`},{tool:`nemu_write_memory`,method:`handleWriteMemory`}]});async function s(e){let{NativeEmulatorHandlers:t}=await import(`./handlers-ByYG27-5.mjs`),n=e.getDomainInstance(a);return n||(n=new t,e.setDomainInstance(a,n)),n}const c={kind:`domain-manifest`,version:1,domain:i,depKey:a,profiles:[`full`],ensure:s,registrations:o,workflowRule:{patterns:[/\b(emulate|emulator|nemu)\b.*(so|native|jni|arm64|aarch64)/i,/(android|flutter|apk).*(native|jni|\.so|sign|crypt|decrypt|encrypt)/i,/\b(jni|java_[a-z])\b.*(emulate|reverse|recover|call)/i,/(in-process|self-?built|no-?device).*(emulat|arm64|native)/i,/(recover|reverse).*(native|jni|signing|crypto).*(algorithm|function|\.so)/i],priority:86,tools:[`nemu_capabilities`,`nemu_create_session`,`nemu_extract_apk_libs`,`nemu_inspect_imports`,`nemu_load_library`,`nemu_list_symbols`,`nemu_setup_java_mock`,`nemu_call_jni_export`,`nemu_trace`,`nemu_disassemble`],hint:`In-process ARM64 emulation: inspect imports → create a session → load a .so (or extract one from an APK) → alloc_memory → call_symbol/call_jni_export → read_memory, or mock Java → call JNI functions → trace. Destroy the session when done.`},prerequisites:{nemu_load_library:[{condition:`An emulator session must exist`,fix:`Call nemu_create_session first and reuse the returned sessionId.`}],nemu_call_symbol:[{condition:`A library must be loaded into the session`,fix:`Call nemu_load_library (or nemu_load_apk_library) before calling a symbol.`}],nemu_call_jni_export:[{condition:`A library must be loaded into the session`,fix:`Call nemu_load_library (or nemu_load_apk_library) first; register any Java callbacks with nemu_setup_java_mock.`}],nemu_list_symbols:[{condition:`A library must be loaded into the session`,fix:`Call nemu_load_library before listing symbols.`}],nemu_trace:[{condition:`A library must be loaded into the session`,fix:`Call nemu_load_library before tracing a symbol.`}]},toolDependencies:[{from:`nemu_extract_apk_libs`,to:`nemu_load_apk_library`,relation:`precedes`,weight:.7},{from:`nemu_load_library`,to:`nemu_call_jni_export`,relation:`precedes`,weight:.6},{from:`nemu_setup_java_mock`,to:`nemu_call_jni_export`,relation:`suggests`,weight:.5}]};export{c as default};
@@ -0,0 +1 @@
1
+ import{ar as e}from"./constants-nvsLpSri.mjs";import{t}from"./registry-DJDnkQW2.mjs";import{n}from"./bind-helpers-D0mGAOof.mjs";import{t as r}from"./tool-builder-CpLh-UQd.mjs";const i=[r(`adb_device_list`,e=>e.desc(`List all connected Android devices and emulators.`).query()),r(`adb_shell`,e=>e.desc(`Execute an ADB shell command on a specific device.`).string(`serial`,`Android device serial or emulator id`).string(`command`,`Shell command to run (e.g. "getprop ro.build.version.release")`).boolean(`allowNonZero`,`Return stdout/stderr/exitCode instead of raising an MCP runtime error on non-zero exit.`,{default:!0}).number(`timeoutMs`,`Optional command timeout in milliseconds.`).number(`maxBufferBytes`,`Optional stdout/stderr max buffer in bytes.`).required(`serial`,`command`)),r(`adb_install`,e=>e.desc(`Install one APK or a split-APK set onto a device with parsed success output.`).string(`serial`,`Android device serial or emulator id`).string(`apkPath`,`Single local APK path to install`).array(`apkPaths`,{type:`string`},`Split APK paths for adb install-multiple`).boolean(`reinstall`,`Pass -r to reinstall an existing package.`,{default:!0}).boolean(`allowDowngrade`,`Pass -d to allow version downgrade.`,{default:!1}).boolean(`grantPermissions`,`Pass -g to grant runtime permissions.`,{default:!1}).boolean(`allowTestOnly`,`Pass -t to allow testOnly APKs.`,{default:!0}).boolean(`installSplit`,`Force adb install-multiple even for a single supplied path.`,{default:!1}).string(`user`,`Optional Android user id for --user`).requiredOpenWorld(`serial`)),r(`adb_uninstall`,e=>e.desc(`Uninstall a package from a device, optionally keeping app data.`).string(`serial`,`Android device serial or emulator id`).string(`packageName`,`Android package name to uninstall`).boolean(`keepData`,`Pass -k to keep app data and cache directories.`,{default:!1}).requiredOpenWorld(`serial`,`packageName`)),r(`adb_input_tap`,e=>e.desc(`Send a touchscreen tap event through adb shell input.`).string(`serial`,`Android device serial or emulator id`).number(`x`,`Screen x coordinate`).number(`y`,`Screen y coordinate`).requiredOpenWorld(`serial`,`x`,`y`)),r(`adb_input_swipe`,e=>e.desc(`Send a touchscreen swipe event through adb shell input.`).string(`serial`,`Android device serial or emulator id`).number(`x1`,`Start x coordinate`).number(`y1`,`Start y coordinate`).number(`x2`,`End x coordinate`).number(`y2`,`End y coordinate`).number(`durationMs`,`Optional swipe duration in milliseconds`).requiredOpenWorld(`serial`,`x1`,`y1`,`x2`,`y2`)),r(`adb_input_keyevent`,e=>e.desc(`Send an Android keyevent name or numeric key code through adb shell input.`).string(`serial`,`Android device serial or emulator id`).string(`keyCode`,`Android key code or name, for example BACK, HOME, or 4`).requiredOpenWorld(`serial`,`keyCode`)),r(`adb_input_text`,e=>e.desc(`Send text through adb shell input text with Android-safe whitespace encoding.`).string(`serial`,`Android device serial or emulator id`).string(`text`,`Text to enter on the device`).requiredOpenWorld(`serial`,`text`)),r(`adb_proc_maps`,e=>e.desc(`Read and parse /proc/PID/maps from a device, resolving PID from packageName when needed.`).string(`serial`,`Android device serial or emulator id`).string(`pid`,`Android process id`).string(`packageName`,`Package name used to resolve PID with pidof -s`).string(`localPath`,`Optional local path to write the raw maps snapshot`).boolean(`includeRaw`,`Include raw maps text in the response.`,{default:!1}).requiredOpenWorld(`serial`)),r(`adb_root_check`,e=>e.desc(`Probe root indicators such as su, Magisk, test-keys, SELinux, and shell uid.`).string(`serial`,`Android device serial or emulator id`).requiredOpenWorld(`serial`).query()),r(`adb_getprop`,e=>e.desc(`Dump and parse Android system properties (getprop) into a structured map with a curated device fingerprint (model, SDK, ABI, build fingerprint, security patch, bootloader lock).`).string(`serial`,`Required. Android device serial or emulator id.`).string(`pattern`,`Optional JavaScript regex applied to property keys (e.g. "ro.build" keeps only build properties).`).requiredOpenWorld(`serial`).query()),r(`adb_screenshot`,e=>e.desc(`Capture a PNG screenshot through adb exec-out screencap -p.`).string(`serial`,`Android device serial or emulator id`).string(`localPath`,`Optional local output PNG path`).requiredOpenWorld(`serial`)),r(`adb_screenrecord`,e=>e.desc(`Record a short MP4 screen capture through adb shell screenrecord and pull it locally.`).string(`serial`,`Android device serial or emulator id`).string(`localPath`,`Optional local output MP4 path`).string(`remotePath`,`Optional temporary device MP4 path`).number(`durationSec`,`Recording duration in seconds, clamped to Android screenrecord limits`).number(`bitRateMbps`,`Optional video bit rate in megabits per second`).string(`size`,`Optional video size such as 1280x720`).requiredOpenWorld(`serial`)),r(`adb_port_forward`,e=>e.desc(`Manage ADB forward/reverse port mappings for device-host bridge workflows.`).string(`serial`,`Android device serial or emulator id`).enum(`action`,[`add`,`remove`,`remove_all`,`list`],`Port mapping action`).enum(`direction`,[`forward`,`reverse`],`forward maps host→device; reverse maps device→host`).string(`local`,`Host-side endpoint such as tcp:9222`).string(`remote`,`Device-side endpoint such as tcp:8080 or localabstract:webview_devtools`).requiredOpenWorld(`serial`,`action`,`direction`)),r(`adb_apk_pull`,e=>e.desc(`Pull an APK from a device to the local filesystem.`).string(`serial`,`Android device serial or emulator id`).string(`packageName`,`Android package name (e.g. com.example.app)`).string(`outputPath`,`Local directory to save the APK (default: current directory)`).string(`outputFile`,`Optional explicit local file path for a single base APK pull`).boolean(`includeSplits`,`Pull all split APKs returned by pm path, not just base.apk`,{default:!1}).boolean(`validateZip`,`Verify pulled APK files are regular ZIP/APK files`,{default:!0}).required(`serial`,`packageName`)),r(`adb_apk_analyze`,e=>e.desc(`Analyze an installed APK: package, permissions, activities, and security info.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`packageName`,`Required. Android package name, for example com.example.app.`).requiredOpenWorld(`serial`,`packageName`)),r(`adb_package_summary`,e=>e.desc(`Return structured Android package metadata: launcher, uid, versions, permissions, components, and native library dirs.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`packageName`,`Required. Android package name, for example com.example.app.`).requiredOpenWorld(`serial`,`packageName`).query()),r(`adb_logcat_query`,e=>e.desc(`Capture and filter Android logcat output in-process without shell grep pipelines.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`packageName`,`Optional package name. If present, PID is resolved and used as a filter.`).string(`pid`,`Optional process id filter.`).string(`pattern`,`Optional JavaScript regex applied to each logcat line.`).number(`tail`,`Number of latest logcat records to request from Android.`,{default:500}).number(`maxLines`,`Maximum matching lines returned.`,{default:100}).boolean(`clearBefore`,`Clear logcat before capture.`,{default:!1}).enum(`minPriority`,[`V`,`D`,`I`,`W`,`E`,`F`,`S`],`Minimum logcat priority to return (e.g. "W" keeps Warn/Error/Fatal/Silent)`).boolean(`structured`,`Parse each line into {timestamp,pid,tid,priority,tag,message} (uses threadtime format)`,{default:!1}).requiredOpenWorld(`serial`).query()),r(`adb_app_cold_start_trace`,e=>e.desc(`High-level Android startup trace: force-stop, clear logcat, start activity with -W, wait, collect PID-filtered logs, and parse launch/Looper timing.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`packageName`,`Required. Android package name, for example com.example.app.`).string(`activity`,`Optional component activity. Defaults to resolved launcher activity.`).number(`waitMs`,`Milliseconds to wait after am start before reading logcat.`,{default:5e3}).number(`logcatTail`,`Number of logcat records to inspect after launch.`,{default:800}).array(`extraPatterns`,{type:`string`},`Optional additional case-insensitive regex filters for logcat lines.`).requiredOpenWorld(`serial`,`packageName`)),r(`adb_file_pull`,e=>e.desc(`Pull a file from an Android device using normal ADB permissions.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`remotePath`,`Required. Path on the Android device.`).string(`localPath`,`Required. Destination path on the local filesystem.`).requiredOpenWorld(`serial`,`remotePath`,`localPath`)),r(`adb_file_push`,e=>e.desc(`Push a local file to an Android device using normal ADB permissions.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`localPath`,`Required. Local file path.`).string(`remotePath`,`Required. Destination path on the Android device.`).requiredOpenWorld(`serial`,`localPath`,`remotePath`)),r(`adb_pull_native_libs`,e=>e.desc(`Pull native shared libraries (.so) for an installed app from a device.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`packageName`,`Required. Android package name, for example com.example.app.`).string(`outputPath`,`Optional. Local directory to save extracted libraries into (default: current directory).`).boolean(`includeSystemLibs`,`Optional. Include system/nativeLibraryDir entries outside the app package path.`,{default:!1}).requiredOpenWorld(`serial`,`packageName`)),r(`adb_webview_list`,t=>t.desc(`List debuggable WebView targets connected via ADB.`).string(`serial`,`Required. Android device serial or emulator id.`).number(`hostPort`,`Optional. Local port to use for forwarding.`,{default:e}).requiredOpenWorld(`serial`)),r(`adb_webview_attach`,t=>t.desc(`Attach to a WebView via ADB; returns WebSocket debugger URL for CDP.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`targetId`,`Required. WebView target id returned by adb_webview_list.`).number(`hostPort`,`Optional. Local port to use for forwarding.`,{default:e}).requiredOpenWorld(`serial`,`targetId`)),r(`adb_dumpsys`,e=>e.desc(`Run adb shell dumpsys for a service and return parsed structured output. Supports key-value extraction, array parsing, and section detection. Common services: package, activity, window, battery, meminfo, alarm, cpuinfo, diskstats, netstats, usagestats.`).string(`serial`,`Required. Android device serial or emulator id.`).string(`service`,`Required. Android service name (e.g. package, meminfo, activity).`).boolean(`includeRaw`,`Include raw dumpsys output in the response.`,{default:!1}).number(`timeoutMs`,`Optional command timeout in milliseconds.`).requiredOpenWorld(`serial`,`service`).query()),r(`adb_ui_dump`,e=>e.desc(`Capture Android UI hierarchy via uiautomator dump. Runs uiautomator dump on-device, pulls the XML, and returns parsed UI tree. Useful for UI automation verification, layout inspection, and accessibility tree analysis.`).string(`serial`,`Required. Android device serial or emulator id.`).boolean(`includeRawXml`,`Include raw XML content in the response.`,{default:!1}).string(`localPath`,`Optional local path to save the pulled XML file.`).number(`timeoutMs`,`Optional timeout in milliseconds.`).requiredOpenWorld(`serial`))],a=`adb-bridge`,o=`adbBridgeHandlers`,s=n({domain:a,depKey:o,lookup:t(i),entries:[{tool:`adb_device_list`,method:`handleDeviceListTool`},{tool:`adb_apk_pull`,method:`handleApkPullTool`},{tool:`adb_shell`,method:`handleShellTool`},{tool:`adb_install`,method:`handleInstallTool`},{tool:`adb_uninstall`,method:`handleUninstallTool`},{tool:`adb_input_tap`,method:`handleInputTapTool`},{tool:`adb_input_swipe`,method:`handleInputSwipeTool`},{tool:`adb_input_keyevent`,method:`handleInputKeyeventTool`},{tool:`adb_input_text`,method:`handleInputTextTool`},{tool:`adb_proc_maps`,method:`handleProcMapsTool`},{tool:`adb_root_check`,method:`handleRootCheckTool`},{tool:`adb_getprop`,method:`handleGetpropTool`},{tool:`adb_screenshot`,method:`handleScreenshotTool`},{tool:`adb_screenrecord`,method:`handleScreenrecordTool`},{tool:`adb_port_forward`,method:`handlePortForwardTool`},{tool:`adb_apk_analyze`,method:`handleAnalyzeApkTool`},{tool:`adb_package_summary`,method:`handlePackageSummaryTool`},{tool:`adb_logcat_query`,method:`handleLogcatQueryTool`},{tool:`adb_app_cold_start_trace`,method:`handleAppColdStartTraceTool`},{tool:`adb_file_pull`,method:`handleFilePullTool`},{tool:`adb_file_push`,method:`handleFilePushTool`},{tool:`adb_pull_native_libs`,method:`handlePullNativeLibsTool`},{tool:`adb_webview_list`,method:`handleWebViewListTool`},{tool:`adb_webview_attach`,method:`handleWebViewAttachTool`},{tool:`adb_dumpsys`,method:`handleDumpsysTool`},{tool:`adb_ui_dump`,method:`handleUiDumpTool`}]});async function c(e){let{ADBBridgeHandlers:t}=await import(`./handlers-CNbhIdSK.mjs`),n=e.getDomainInstance(o);if(n)return n;let r=new t;return e.setDomainInstance(o,r),r}const l={kind:`domain-manifest`,version:1,domain:a,depKey:o,profiles:[`full`],registrations:s,ensure:c,workflowRule:{patterns:[/(android|adb|mobile|apk|device).*(list|shell|pull|analyze)/i,/(android|adb).*(logcat|cold\s*start|startup|launch|activity|pid)/i,/(adb|android).*(webview|chrome|debug|cdp|inspect)/i,/(android|adb).*(native|\.so|libapp|libflutter|shared\s+library)/i,/(adb|android).*(install|uninstall|tap|swipe|keyevent|input|screenshot|screenrecord|record|root|proc|maps|forward|reverse|port|getprop|propert|fingerprint)/i],priority:75,tools:[`adb_device_list`,`adb_shell`,`adb_install`,`adb_uninstall`,`adb_input_tap`,`adb_input_swipe`,`adb_input_keyevent`,`adb_input_text`,`adb_proc_maps`,`adb_root_check`,`adb_getprop`,`adb_screenshot`,`adb_screenrecord`,`adb_port_forward`,`adb_apk_pull`,`adb_apk_analyze`,`adb_package_summary`,`adb_logcat_query`,`adb_app_cold_start_trace`,`adb_file_pull`,`adb_file_push`,`adb_pull_native_libs`,`adb_webview_list`,`adb_webview_attach`],hint:`Android/ADB: list devices → pull/analyze APK → package summary → cold-start/logcat trace → debug WebViews via CDP`},prerequisites:{"*":[{condition:`ADB server binary must be in PATH`,fix:`Install Android Platform Tools: https://developer.android.com/studio/command-line/adb`}],adb_webview_list:[{condition:`App must have android:debuggable="true"`,fix:`Use a debug build of the Android app`}],adb_webview_attach:[{condition:`App must have android:debuggable="true"`,fix:`Use a debug build of the Android app`}]},toolDependencies:[{from:`browser`,to:`adb-bridge`,relation:`uses`,weight:.7}]};export{l as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./tool-builder-CpLh-UQd.mjs";const r=[n(`payload_template_build`,e=>e.desc(`Build a deterministic payload from field definitions.`).array(`fields`,{type:`object`,properties:{name:{type:`string`,description:`Field name`},type:{type:`string`,enum:[`u8`,`u16`,`u32`,`i8`,`i16`,`i32`,`string`,`bytes`],description:`Field type`},value:{description:`Numeric or string field value`},encoding:{type:`string`,enum:[`utf8`,`ascii`,`hex`,`base64`],description:`String/bytes encoding override`},length:{type:`number`,description:`Optional fixed length`},padByte:{type:`number`,description:`Optional pad byte`}},required:[`name`,`type`,`value`]},`Field definitions in output order`).enum(`endian`,[`big`,`little`],`Integer byte order`,{default:`big`}).required(`fields`).idempotent()),n(`payload_mutate`,e=>e.desc(`Apply deterministic byte-level mutations to a hex payload.`).string(`hexPayload`,`Source payload as a hex string`).array(`mutations`,{type:`object`,properties:{strategy:{type:`string`,enum:[`set_byte`,`flip_bit`,`overwrite_bytes`,`append_bytes`,`truncate`,`increment_integer`],description:`Mutation strategy`},offset:{type:`number`,description:`Zero-based byte offset`},value:{type:`number`,description:`Byte value for set_byte`},bit:{type:`number`,description:`Bit index for flip_bit`},data:{type:`string`,description:`Mutation data for overwrite/append`},encoding:{type:`string`,enum:[`utf8`,`ascii`,`hex`,`base64`],description:`Data encoding for overwrite/append`},length:{type:`number`,description:`Target length for truncate`},width:{type:`number`,enum:[1,2,4],description:`Integer width in bytes`},delta:{type:`number`,description:`Increment/decrement delta`},endian:{type:`string`,enum:[`big`,`little`],description:`Integer byte order`},signed:{type:`boolean`,description:`Treat increment target as signed`}},required:[`strategy`]},`Byte-level mutations to apply in order`).required(`hexPayload`,`mutations`)),n(`ethernet_frame_build`,e=>e.desc(`Build a deterministic Ethernet II frame from source/destination MAC addresses, EtherType, and payload bytes.`).string(`destinationMac`,`Destination MAC address in colon, dash, dotted, or plain hex form`).string(`sourceMac`,`Source MAC address in colon, dash, dotted, or plain hex form`).string(`etherType`,`EtherType name (arp, ipv4, ipv6, vlan) or a 16-bit hex value such as 0800`).string(`payloadHex`,`Frame payload as a hex string`).required(`destinationMac`,`sourceMac`,`etherType`,`payloadHex`).idempotent()),n(`arp_build`,e=>e.desc(`Build a deterministic ARP payload for Ethernet/IPv4.`).enum(`operation`,[`request`,`reply`],`ARP operation code`,{default:`request`}).string(`senderMac`,`Sender hardware address`).string(`senderIp`,`Sender IPv4 address`).string(`targetMac`,`Target hardware address (use zeros for requests)`,{default:`00:00:00:00:00:00`}).string(`targetIp`,`Target IPv4 address`).number(`hardwareType`,`Hardware type number. Default: 1 (Ethernet)`,{default:1}).string(`protocolType`,`Protocol type name (ipv4) or 16-bit hex value. Default: ipv4`,{default:`ipv4`}).number(`hardwareSize`,`Hardware address size in bytes. Default: 6`,{default:6}).number(`protocolSize`,`Protocol address size in bytes. Default: 4`,{default:4}).required(`senderMac`,`senderIp`,`targetIp`).idempotent()),n(`raw_ip_packet_build`,e=>e.desc(`Build a deterministic IPv4 or IPv6 packet.`).enum(`version`,[`ipv4`,`ipv6`],`IP version`,{default:`ipv4`}).string(`sourceIp`,`Source IPv4/IPv6 address`).string(`destinationIp`,`Destination IPv4/IPv6 address`).string(`protocol`,`Protocol/next-header name (icmp, tcp, udp, icmpv6) or an 8-bit integer string/hex value`).string(`payloadHex`,`Inner payload as a hex string`,{default:``}).number(`ttl`,`IPv4 TTL or IPv6 hop limit fallback. Default: 64`,{default:64}).number(`hopLimit`,`Explicit IPv6 hop limit override`).number(`identification`,`IPv4 identification field. Default: 0`,{default:0}).boolean(`dontFragment`,`Set the IPv4 DF flag`,{default:!1}).boolean(`moreFragments`,`Set the IPv4 MF flag`,{default:!1}).number(`fragmentOffset`,`IPv4 fragment offset in 8-byte units. Default: 0`,{default:0}).number(`dscp`,`IPv4 DSCP or IPv6 traffic-class DSCP value (0-63). Default: 0`,{default:0}).number(`ecn`,`IPv4/IPv6 ECN bits (0-3). Default: 0`,{default:0}).number(`flowLabel`,`IPv6 flow label (0-1048575). Default: 0`,{default:0}).required(`version`,`sourceIp`,`destinationIp`,`protocol`).idempotent()),n(`icmp_echo_build`,e=>e.desc(`Build a deterministic ICMPv4 echo request or reply payload with an automatically computed checksum.`).enum(`operation`,[`request`,`reply`],`ICMP echo operation`,{default:`request`}).number(`identifier`,`ICMP echo identifier field. Default: 0`,{default:0}).number(`sequenceNumber`,`ICMP echo sequence number field. Default: 0`,{default:0}).string(`payloadHex`,`Optional ICMP payload as a hex string`,{default:``}).idempotent()),n(`checksum_apply`,e=>e.desc(`Apply a deterministic 16-bit Internet checksum across a payload slice, optionally zeroing and writing the checksum field back into the packet.`).string(`hexPayload`,`Source payload as a hex string`).number(`startOffset`,`Inclusive start offset for checksum range. Default: 0`,{default:0}).number(`endOffset`,`Exclusive end offset for checksum range. Default: payload length`).number(`zeroOffset`,`Optional checksum field offset to zero before calculation`).number(`zeroLength`,`Checksum field width in bytes when zeroOffset is set. Default: 2`,{default:2}).number(`writeOffset`,`Optional destination offset for writing the computed checksum. Defaults to zeroOffset when provided`).enum(`endian`,[`big`,`little`],`Byte order used when writing the checksum back`,{default:`big`}).required(`hexPayload`).idempotent()),n(`pcap_write`,e=>e.desc(`Write a compact classic PCAP file from deterministic packet byte records.`).string(`path`,`Destination path for the PCAP file`).array(`packets`,{type:`object`,properties:{dataHex:{type:`string`,description:`Packet bytes as a hex string`},timestampSeconds:{type:`number`,description:`Unix timestamp seconds. Defaults to 0 when omitted`},timestampFraction:{type:`number`,description:`Microsecond or nanosecond fraction depending on timestampPrecision`},originalLength:{type:`number`,description:`Original on-wire packet length. Defaults to included length`}},required:[`dataHex`]},`Packet records to serialize in order`).enum(`endianness`,[`little`,`big`],`PCAP byte order for numeric fields`,{default:`little`}).enum(`timestampPrecision`,[`micro`,`nano`],`Timestamp precision marker in the PCAP magic`,{default:`micro`}).number(`snapLength`,`Global snapshot length. Default: 65535`,{default:65535}).string(`linkType`,`Link-layer type name (ethernet, raw, loopback) or integer string`,{default:`ethernet`}).required(`path`,`packets`).idempotent()),n(`pcap_read`,e=>e.desc(`Read a classic PCAP file and return compact deterministic packet summaries. PCAPNG is intentionally not supported.`).string(`path`,`Path to the PCAP file to parse`).number(`maxPackets`,`Maximum number of packet records to decode`).number(`maxBytesPerPacket`,`Maximum payload bytes to return per packet before truncating the reported hex payload`).required(`path`).query()),n(`pcapng_write`,e=>e.desc(`Write a PCAPNG (pcap-ng) capture file from one or more interfaces and deterministic packet byte records. Emits a Section Header Block, an Interface Description Block per interface, and an Enhanced Packet Block per packet.`).string(`path`,`Destination path for the PCAPNG file`).array(`interfaces`,{type:`object`,properties:{linkType:{type:`number`,description:`Link-layer type code (LINKTYPE_). Ethernet = 1, raw = 101, loopback = 0`},snapLen:{type:`number`,description:`Per-interface snapshot length. Default: 262144`},name:{type:`string`,description:`Optional interface name (if_name option)`}},required:[`linkType`]},`Interface Description Blocks to emit in order`).array(`packets`,{type:`object`,properties:{dataHex:{type:`string`,description:`Packet bytes as a hex string`},interfaceId:{type:`number`,description:`Index into the interfaces array. Default: 0`},timestampHigh:{type:`number`,description:`Upper 32 bits of the 64-bit timestamp. Default: 0`},timestampLow:{type:`number`,description:`Lower 32 bits of the 64-bit timestamp. Default: 0`},originalLength:{type:`number`,description:`Original on-wire packet length. Defaults to included length`}},required:[`dataHex`]},`Enhanced Packet Blocks to serialize in order`).enum(`endianness`,[`little`,`big`],`PCAPNG byte order for numeric fields`,{default:`little`}).number(`majorVersion`,`Section Header major version. Default: 1`,{default:1}).number(`minorVersion`,`Section Header minor version. Default: 0`,{default:0}).required(`path`,`interfaces`,`packets`).idempotent()),n(`pcapng_read`,e=>e.desc(`Read a PCAPNG (pcap-ng) capture file and return structured Section/Interface/Packet blocks. Supports Section Header, Interface Description, Enhanced/Simple Packet, Name Resolution, and Interface Statistics blocks; unknown block types are surfaced as warnings.`).string(`path`,`Path to the PCAPNG file to parse`).number(`maxPackets`,`Maximum number of packet records to decode`).number(`maxBytesPerPacket`,`Maximum payload bytes to return per packet before truncating the reported hex payload`).number(`interfaceFilter`,`When set, only Enhanced Packet Blocks matching this interface ID are returned (Simple Packet Blocks pass through)`).required(`path`).query()),n(`proto_dissect_dns`,e=>e.desc(`Dissect a raw DNS payload (RFC 1035 + EDNS(0)) into header flags, questions, answers, authorities, and additionals with full compression-pointer handling and OPT pseudo-record decoding.`).string(`packetHex`,`Raw DNS payload as a hex string (UDP or TCP segment body)`).number(`maxPointerDepth`,`Maximum compression-pointer recursion depth before bailing (default: 10)`).required(`packetHex`).query()),n(`proto_dissect_http`,e=>e.desc(`Dissect a raw HTTP/1.x request or response payload (RFC 7230) into the start line, headers, and body. Unwinds chunked transfer-encoding and reports Content-Length / Content-Type / Content-Encoding hints.`).string(`packetHex`,`Raw HTTP payload as a hex string (single segment, not a reassembled stream)`).required(`packetHex`).query()),n(`proto_define_pattern`,e=>e.desc(`Define a protocol pattern with delimiter, byte order, and field layout.`).string(`name`,`Pattern name`).prop(`spec`,{type:`object`,description:`Pattern specification object`,additionalProperties:!0}).required(`spec`).idempotent()),n(`proto_auto_detect`,e=>e.desc(`Auto-detect a protocol pattern from one or more hex payload samples.`).array(`hexPayloads`,{type:`string`},`Hex payload samples`).required(`hexPayloads`).query()),n(`proto_export_schema`,e=>e.desc(`Export a protocol pattern to a schema definition. format: proto (default, .proto-like text), ksy (Kaitai Struct for Wireshark/010 Editor), json-schema (draft-07).`).string(`patternId`,`Pattern ID to export`).enum(`format`,[`proto`,`ksy`,`json-schema`],`Output schema format`,{default:`proto`}).required(`patternId`).query()),n(`proto_infer_fields`,e=>e.desc(`Infer likely protocol fields from repeated hex payload samples.`).array(`hexPayloads`,{type:`string`},`Hex payload samples`).required(`hexPayloads`).query()),n(`proto_infer_state_machine`,e=>e.desc(`Infer a protocol state machine from captured message sequences.`).array(`messages`,{type:`object`,properties:{direction:{type:`string`,enum:[`req`,`res`],description:`Message direction`},timestamp:{type:`number`,description:`Message timestamp`},fields:{type:`object`,description:`Decoded message fields`,additionalProperties:!0},raw:{type:`string`,description:`Raw message or payload summary`}},required:[`direction`,`timestamp`,`fields`,`raw`]},`Captured protocol messages`).required(`messages`).query()),n(`proto_visualize_state`,e=>e.desc(`Generate a Mermaid state diagram from a protocol state machine definition.`).prop(`stateMachine`,{type:`object`,description:`State machine definition with states and transitions`,additionalProperties:!0}).query()),n(`proto_fingerprint`,e=>e.desc(`Identify protocol type from hex payload samples.`).array(`hexPayloads`,{type:`string`},`Hex payload samples to fingerprint`).boolean(`includeKnownProtocols`,`Match against known protocol signatures`,{default:!0}).boolean(`includeFieldHints`,`Suggest likely field boundaries`,{default:!0}).required(`hexPayloads`).query())],i=`protocol-analysis`,a=`protocolAnalysisHandlers`,o=t({domain:i,depKey:a,lookup:e(r),entries:[{tool:`proto_define_pattern`,method:`handleDefinePatternTool`},{tool:`proto_auto_detect`,method:`handleAutoDetectTool`},{tool:`proto_infer_fields`,method:`handleInferFieldsTool`},{tool:`proto_infer_state_machine`,method:`handleInferStateMachineTool`},{tool:`proto_export_schema`,method:`handleExportSchemaTool`},{tool:`proto_visualize_state`,method:`handleVisualizeStateTool`},{tool:`payload_template_build`,method:`handlePayloadTemplateBuildTool`},{tool:`payload_mutate`,method:`handlePayloadMutateTool`},{tool:`ethernet_frame_build`,method:`handleEthernetFrameBuildTool`},{tool:`arp_build`,method:`handleArpBuildTool`},{tool:`raw_ip_packet_build`,method:`handleRawIpPacketBuildTool`},{tool:`icmp_echo_build`,method:`handleIcmpEchoBuildTool`},{tool:`checksum_apply`,method:`handleChecksumApplyTool`},{tool:`pcap_write`,method:`handlePcapWriteTool`},{tool:`pcap_read`,method:`handlePcapReadTool`},{tool:`pcapng_write`,method:`handlePcapngWriteTool`},{tool:`pcapng_read`,method:`handlePcapngReadTool`},{tool:`proto_dissect_dns`,method:`handleProtoDissectDnsTool`},{tool:`proto_dissect_http`,method:`handleProtoDissectHttpTool`},{tool:`proto_fingerprint`,method:`handleProtoFingerprintTool`}]});async function s(e){let{ProtocolAnalysisHandlers:t}=await import(`./handlers-KY0g31ny.mjs`),n=e.getDomainInstance(a);if(n)return n;let r=new t(void 0,void 0,e.eventBus);return e.setDomainInstance(a,r),r}const c={kind:`domain-manifest`,version:1,domain:i,depKey:a,profiles:[`full`],ensure:s,registrations:o,prerequisites:{proto_auto_detect:[{condition:`At least one hex payload sample is required`,fix:`Capture traffic using network monitoring tools first`}],proto_infer_state_machine:[{condition:`Multiple message samples are required for state machine inference`,fix:`Capture message sequences with mojo-ipc or network tools`}]},workflowRule:{patterns:[/protocol\s+(reverse|analysis|pattern|state\s*machine|schema)/i,/custom\s+protocol|binary\s+protocol|wire\s+format/i,/infer\s+(protocol|fields|state\s*machine)/i,/proto.*export|proto.*schema|proto.*diagram/i,/payload\s+(template|build|mutate)|packet\s+(template|mutate)/i,/ethernet|arp|ipv4|ipv6|pcap|internet\s+checksum|raw\s+packet/i,/(decode|payload|bytes?|hex|protobuf|msgpack).*(protocol|field|state\s*machine)/i,/(base64|hex|protobuf|msgpack).*(payload|protocol|field|decode)/i,/(crypto\s*harness|checksum|payload\s+rebuild|payload\s+template).*(protocol|payload|decode)/i,/(无状态|纯算|确定性|解码|载荷|字节|报文).*(协议|字段|状态机)/i],priority:.6,tools:[`binary_detect_format`,`binary_decode`,`proto_auto_detect`,`proto_infer_fields`,`proto_define_pattern`,`proto_infer_state_machine`,`proto_export_schema`,`proto_visualize_state`,`payload_template_build`,`payload_mutate`,`checksum_apply`,`crypto_test_harness`,`ethernet_frame_build`,`arp_build`,`raw_ip_packet_build`,`icmp_echo_build`,`pcap_write`,`pcap_read`,`pcapng_write`,`pcapng_read`,`proto_dissect_dns`,`proto_dissect_http`],hint:`Capture or craft packet bytes -> build Ethernet/ARP/IP/ICMP headers -> apply deterministic checksums and payload mutations -> read/write PCAP or PCAPNG files -> dissect DNS/HTTP payloads or infer fields/state machines from resulting payloads`},toolDependencies:[{from:`network_get_requests`,to:`binary_decode`,relation:`suggests`,weight:.9},{from:`binary_decode`,to:`proto_auto_detect`,relation:`precedes`,weight:.95},{from:`proto_auto_detect`,to:`proto_infer_fields`,relation:`precedes`,weight:.95},{from:`proto_infer_fields`,to:`proto_infer_state_machine`,relation:`precedes`,weight:.9},{from:`detect_crypto`,to:`crypto_test_harness`,relation:`suggests`,weight:.8},{from:`network`,to:`protocol-analysis`,relation:`uses`,weight:.7}]};export{c as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ensure-browser-core-BP70x0TB.mjs";import{t}from"./registry-DJDnkQW2.mjs";import{n}from"./bind-helpers-D0mGAOof.mjs";import{t as r}from"./definitions-BKpRDjcI.mjs";const i=`streaming`,a=`streamingHandlers`,o=n({domain:i,depKey:a,lookup:t(r),entries:[{tool:`ws_monitor`,method:`handleWsMonitorDispatchTool`},{tool:`ws_get_frames`,method:`handleWsGetFramesTool`},{tool:`ws_get_connections`,method:`handleWsGetConnectionsTool`},{tool:`ws_export_capture`,method:`handleWsExportCaptureTool`},{tool:`ws_send_frame`,method:`handleWsSendFrameTool`},{tool:`sse_monitor_enable`,method:`handleSseMonitorEnableTool`},{tool:`sse_get_events`,method:`handleSseGetEventsTool`},{tool:`sse_export_capture`,method:`handleSseExportCaptureTool`},{tool:`grpc_monitor`,method:`handleGrpcMonitorTool`},{tool:`grpc_get_calls`,method:`handleGrpcGetCallsTool`},{tool:`grpc_export_capture`,method:`handleGrpcExportCaptureTool`},{tool:`fetch_stream_monitor`,method:`handleFetchStreamMonitorTool`},{tool:`fetch_stream_get_events`,method:`handleFetchStreamGetEventsTool`},{tool:`fetch_stream_export_capture`,method:`handleFetchStreamExportCaptureTool`},{tool:`webrtc_monitor`,method:`handleWebRtcMonitorTool`},{tool:`webrtc_get_events`,method:`handleWebRtcGetEventsTool`},{tool:`webrtc_export_capture`,method:`handleWebRtcExportCaptureTool`}]});async function s(t){let{StreamingToolHandlers:n}=await import(`./streaming-DkpE3GGU.mjs`);return await e(t),t.streamingHandlers||=new n(t.collector),t.streamingHandlers}const c={kind:`domain-manifest`,version:1,domain:i,depKey:a,profiles:[`workflow`,`full`],ensure:s,registrations:o};export{c as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-BlPHe5DX.mjs";const r=`network`,i=`advancedHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`network_enable`,method:`handleNetworkEnable`},{tool:`network_disable`,method:`handleNetworkDisable`},{tool:`network_get_status`,method:`handleNetworkGetStatus`},{tool:`network_monitor`,method:`handleNetworkMonitor`},{tool:`network_get_requests`,method:`handleNetworkGetRequests`},{tool:`network_get_response_body`,method:`handleNetworkGetResponseBody`},{tool:`network_get_stats`,method:`handleNetworkGetStats`},{tool:`performance_get_metrics`,method:`handlePerformanceGetMetrics`},{tool:`performance_coverage`,method:`handlePerformanceCoverage`},{tool:`performance_take_heap_snapshot`,method:`handlePerformanceTakeHeapSnapshot`},{tool:`performance_trace`,method:`handlePerformanceTraceDispatch`},{tool:`profiler_cpu`,method:`handleProfilerCpuDispatch`},{tool:`profiler_heap_sampling`,method:`handleProfilerHeapSamplingDispatch`},{tool:`console_get_exceptions`,method:`handleConsoleGetExceptions`},{tool:`console_inject`,method:`handleConsoleInjectDispatch`},{tool:`console_inject_fetch_interceptor`,method:`handleConsoleInjectFetchInterceptor`},{tool:`console_inject_xhr_interceptor`,method:`handleConsoleInjectXhrInterceptor`},{tool:`console_buffers`,method:`handleConsoleBuffersDispatch`},{tool:`http_request_build`,method:`handleHttpRequestBuild`},{tool:`http_plain_request`,method:`handleHttpPlainRequest`},{tool:`http2_probe`,method:`handleHttp2Probe`},{tool:`http2_frame_build`,method:`handleHttp2FrameBuild`},{tool:`http2_frame_parse`,method:`handleHttp2FrameParse`},{tool:`network_http2_fingerprint`,method:`handleNetworkHttp2Fingerprint`},{tool:`grpc_frame_parse`,method:`handleGrpcFrameParse`},{tool:`grpc_frame_build`,method:`handleGrpcFrameBuild`},{tool:`network_rtt_measure`,method:`handleNetworkRttMeasure`},{tool:`network_latency_stats`,method:`handleNetworkLatencyStats`},{tool:`network_traceroute`,method:`handleNetworkTraceroute`},{tool:`network_icmp_probe`,method:`handleNetworkIcmpProbe`},{tool:`dns_resolve`,method:`handleDnsResolve`},{tool:`dns_reverse`,method:`handleDnsReverse`},{tool:`dns_probe`,method:`handleDnsProbe`},{tool:`dns_cname_chain`,method:`handleDnsCnameChain`},{tool:`dns_bulk_resolve`,method:`handleDnsBulkResolve`},{tool:`network_extract_auth`,method:`handleNetworkExtractAuth`},{tool:`network_export_har`,method:`handleNetworkExportHar`},{tool:`network_replay_request`,method:`handleNetworkReplayRequest`},{tool:`network_intercept`,method:`handleNetworkInterceptDispatch`},{tool:`network_tls_fingerprint`,method:`handleNetworkTlsFingerprint`},{tool:`network_bot_detect_analyze`,method:`handleNetworkBotDetectAnalyze`}]}),o=new Set([`http_request_build`,`http_plain_request`,`http2_probe`,`http2_frame_build`,`http2_frame_parse`,`network_http2_fingerprint`,`grpc_frame_parse`,`grpc_frame_build`,`network_rtt_measure`,`network_latency_stats`,`network_traceroute`,`network_icmp_probe`,`dns_resolve`,`dns_reverse`,`dns_probe`,`dns_cname_chain`,`dns_bulk_resolve`]);async function s(e){let{AdvancedToolHandlers:t}=await import(`./network-C5Y-S87J.mjs`);if(!(e.activatedToolNames instanceof Set)||[...e.activatedToolNames].some(e=>!o.has(e))){let{ensureBrowserCore:t}=await import(`./ensure-browser-core-BP70x0TB.mjs`).then(e=>e.n);await t(e)}return e.advancedHandlers||=new t(e.collector,e.consoleMonitor,e.eventBus,()=>e.traceRecorder??null),e.advancedHandlers}const c={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`workflow`,`full`],ensure:s,workflowRule:{patterns:[/(capture|intercept|monitor|hook).*(network|request|response|api|traffic)/i,/(抓包|拦截|监控|hook).*(网络|请求|响应|api|流量)/i],priority:100,tools:[`network_monitor`,`page_navigate`,`network_get_requests`],hint:`Network capture workflow: bootstrap browser/page state -> enable capture -> navigate or act -> inspect captured requests. (Tip: list_extension_workflows can suggest higher-level recipes.)`},prerequisites:{network_get_requests:[{condition:`Browser must be launched`,fix:`Call browser_launch or browser_attach first`},{condition:`Network monitoring must be enabled`,fix:`Call network_monitor(enable) first`}],network_get_response_body:[{condition:`Browser must be launched`,fix:`Call browser_launch or browser_attach first`},{condition:`Network monitoring must be enabled`,fix:`Call network_monitor(enable) first`}],network_extract_auth:[{condition:`Network monitoring must be enabled`,fix:`Call network_monitor(enable) first`}]},registrations:a};export{c as default};
@@ -0,0 +1,12 @@
1
+ import{i as e}from"./outputPaths-CHtELDyi.mjs";import{i as t,n}from"./artifacts-Bx9GLx4J.mjs";import{i as r,n as i,r as a}from"./v8-inspector-CTJo08-K.mjs";import{c as o,i as s,n as c,u as l}from"./parse-args-B6dwWc9k.mjs";import{r as u}from"./ResponseBuilder-BLicSCjn.mjs";import{t as d}from"./bind-helpers-D0mGAOof.mjs";import{t as f}from"./tool-builder-CpLh-UQd.mjs";import{t as p}from"./cdp-session-Dy4OwMOP.mjs";import{join as m,relative as h,resolve as g}from"node:path";import{mkdir as _,readFile as v,readdir as y,rm as b,stat as x,writeFile as S}from"node:fs/promises";const C=[f(`v8_heap_snapshot_capture`,e=>e.desc(`Capture a V8 heap snapshot for offline analysis. The snapshot is persisted to artifacts/heap-snapshots/ (data + sidecar meta) so it survives a server restart; set persist=false to keep it in-memory only.`).boolean(`persist`,`Persist to artifacts/heap-snapshots/ (default: true)`,{default:!0}).query()),f(`v8_heap_snapshot_analyze`,e=>e.desc(`Analyze a heap snapshot: class histogram (object count/sizes by constructor), statistics (total objects, detached DOM nodes), optional dominator tree, and leak detection.`).string(`snapshotId`,`Snapshot ID`).number(`topN`,`Number of top classes to return in histogram (default: 50)`).boolean(`includeDominatorTree`,`Include dominator tree in analysis (default: false)`).number(`depth`,`Dominator tree depth limit (default: 3)`).boolean(`includeLeakDetection`,`Include memory leak detection (default: false)`).number(`minLeakSize`,`Minimum leak size in bytes (default: 1MB)`).required(`snapshotId`).query()),f(`v8_heap_diff`,e=>e.desc(`Compare two heap snapshots to find allocation changes.`).string(`beforeSnapshotId`,`Baseline snapshot ID`).string(`afterSnapshotId`,`Updated snapshot ID`).number(`topN`,`Number of top added/removed nodes to return (default: 50)`).required(`beforeSnapshotId`,`afterSnapshotId`).query()),f(`v8_object_inspect`,e=>e.desc(`Inspect a live JS object by objectId with property enumeration.`).string(`address`,`Runtime objectId or compatible heap object id`).required(`address`).query()),f(`v8_heap_stats`,e=>e.desc(`Report V8 heap statistics: used, total, external.`).query()),f(`v8_bytecode_extract`,e=>e.desc(`Extract V8 bytecode for a script by scriptId, with source fallback.`).string(`scriptId`,`CDP scriptId`).number(`functionOffset`,`Optional function byte offset`).boolean(`includeSourceFallback`,`Include source-derived fallback output`).required(`scriptId`).query()),f(`v8_version_detect`,e=>e.desc(`Detect V8 engine version, flags, and runtime capabilities.`).query()),f(`v8_jit_inspect`,e=>e.desc(`Report JIT compilation status and optimization tier for a script.`).string(`scriptId`,`CDP scriptId`).required(`scriptId`).query()),f(`v8_heap_find_leaks`,e=>e.desc(`Find suspected memory leaks in a heap snapshot. Returns leak candidates sorted by confidence, including detached DOM nodes, large arrays, closure leaks, and unexpectedly large retained objects.`).string(`snapshotId`,`Snapshot ID to analyze`).number(`minRetainedSize`,`Minimum retained size in bytes to consider (default: 1MB)`).number(`maxResults`,`Maximum number of leak candidates to return (default: 20)`).required(`snapshotId`).query()),f(`v8_heap_retainers`,e=>e.desc(`Trace retainer chains from suspect leak objects back to GC roots. For each nodeId, walks the immediate-dominator chain to produce a "what keeps it alive" path: leaf → ... → GC root. Each step includes nodeId, name, className, shallowSize, retainedSize, and distance from the leaf. Use after v8_heap_find_leaks or v8_heap_snapshot_analyze to understand why a specific object is not being collected.`).string(`snapshotId`,`Snapshot ID taken with v8_heap_snapshot_capture`).array(`nodeIds`,{type:`number`},`One or more nodeIds to trace (from leak candidates or class histogram)`).number(`maxSteps`,`Maximum steps per chain (default: 50)`).required(`snapshotId`,`nodeIds`).query()),f(`v8_deopt_trace`,e=>e.desc(`Trace V8 deoptimization events during a capture window. Enables %TraceDeoptimizations via natives syntax and captures deopt events (function name, reason, bailout position). Requires V8 natives syntax. Falls back gracefully when unavailable.`).number(`durationMs`,`Trace window duration in ms (default: 5000)`,{default:5e3,minimum:100,maximum:6e4}).number(`maxEvents`,`Maximum deopt events to capture (default: 50)`,{default:50}).boolean(`enable`,`Enable deopt tracing (default: true)`,{default:!0}).query()),f(`v8_turbofan_inspect`,e=>e.desc(`Inspect TurboFan compilation state for functions in a script. Reports optimization tier (interpreted/maglev/turbofan). Supports actions: inspect (default), optimize (%OptimizeFunctionOnNextCall), deoptimize (%DeoptimizeFunction). Requires V8 natives syntax.`).string(`scriptId`,`CDP scriptId to inspect`).string(`functionName`,`Optional function name filter (substring match)`).string(`action`,`Action: inspect (query status), optimize (force optimize), deoptimize (force deopt)`).number(`topN`,`Maximum functions to inspect (default: 10)`,{default:10}).required(`scriptId`).query()),f(`v8_turbofan_graph`,e=>e.desc(`Collect and visualize V8 TurboFan IR (sea-of-nodes / Turboshaft graph). Two modes: (1) Provide JS source code — spawns an isolated V8 child with --trace-turbo to generate IR JSON, then parses nodes, edges, phases, and opcode histogram. (2) Provide a traceDir path to read already-generated turbo-*.json files (e.g. from a browser launched with --trace-turbo). Returns per-function graph summaries with phase-level node/edge counts, sample nodes, and opcode distribution.`).string(`source`,`JS source code to compile and trace (source mode)`).string(`traceDir`,`Path to directory containing turbo-*.json files (directory mode)`).string(`functionName`,`Optional function name for --trace-turbo-filter (default: anonymous)`).string(`phaseFilter`,`Optional: only include phases whose name contains this substring`).number(`maxNodesPerPhase`,`Max sample nodes per phase in output (default: 20)`,{default:20}).boolean(`includePhases`,`Include per-phase breakdown with sample nodes (default: false)`,{default:!1}).number(`timeoutMs`,`Timeout for isolated V8 process in ms (default: 30000)`,{default:3e4}).boolean(`keepTraceDir`,`Keep temp trace directory after parsing (default: false)`,{default:!1}).query()),f(`v8_function_retained`,e=>e.desc(`Find all heap objects retained by functions matching a name pattern. Walks the dominator tree to find objects whose constructor/class name matches the given pattern, then returns each with its retainer chain. Useful for understanding which objects a specific function/class is holding alive.`).string(`snapshotId`,`Snapshot ID taken with v8_heap_snapshot_capture`).string(`pattern`,`Substring to match against heap object names (case-insensitive)`).number(`maxResults`,`Maximum results to return (default: 50)`,{default:50}).number(`minRetainedSize`,`Minimum retained size filter in bytes (default: 0)`,{default:0}).required(`snapshotId`,`pattern`).query()),f(`v8_object_compare`,e=>e.desc(`Compare heap objects by shallow/retained size, class name, and property count. Same-snapshot mode (objectIds only) does all-pairs comparison (n-choose-2). Cross-snapshot mode (anotherSnapshotId + anotherObjectIds) does pairwise A[i]↔B[i] comparison. Use to track object growth over time, find memory regression candidates, or compare leaked vs healthy objects of the same class.`).string(`snapshotId`,`Primary snapshot ID`).array(`objectIds`,{type:`number`},`One or more nodeIds to compare (max 50)`).string(`anotherSnapshotId`,`Optional: second snapshot ID for cross-snapshot comparison (requires anotherObjectIds)`).array(`anotherObjectIds`,{type:`number`},`Optional: matching nodeIds from the second snapshot (must match objectIds length)`).number(`minDeltaBytes`,`Minimum delta in bytes to flag as interesting (default: 1024)`,{default:1024}).required(`snapshotId`,`objectIds`).query()),f(`v8_wasm_inspect`,e=>e.desc(`Inspect WebAssembly modules and garbage-collected WASM objects in the page. Discovers .wasm script resources via performance.getEntriesByType, detects WASM GC (struct/array/ref-types) availability, and enumerates feature flags (gc/threads/simd). Supports optional scriptId filter to inspect a specific WASM module. Requires browser/page CDP context. Note: structural type enumeration (includeStructs) requires Chrome ≥ M119 with --enable-features=WebAssemblyGC; absent that, returns gcAvailable flag and script-level summary only.`).string(`scriptId`,`Optional: CDP scriptId of a specific WASM module to inspect. Omit for discovery mode.`).boolean(`includeStructs`,`Include struct type enumeration (default: true)`,{default:!0}).query()),f(`v8_heap_sampling`,e=>e.desc(`Collect a V8 allocation sampling profile via CDP HeapProfiler. Starts sampling for a capture window (default 5s), then returns the aggregated allocation call tree: per-function self/total bytes + sample count, sorted by total bytes allocated. Useful for finding hot allocation sites without a full heap snapshot. Requires browser/page CDP context.`).number(`durationMs`,`Sampling capture window in ms (default: 5000, max: 60000)`,{default:5e3}).number(`topN`,`Number of top allocation sites to return (default: 50)`,{default:50}).query()),f(`v8_allocation_track`,e=>e.desc(`Track live V8 allocations via CDP HeapProfiler object tracking. Starts allocation tracking for a capture window (default 3s), then returns currently-live objects seen during the window with their allocation stack (top frame + size). Useful for finding objects that survive GC during a specific interaction. Requires browser/page CDP context and V8 natives for full stack resolution.`).number(`durationMs`,`Tracking capture window in ms (default: 3000, max: 30000)`,{default:3e3}).number(`topN`,`Number of top live objects to return (default: 50)`,{default:50}).query()),f(`v8_weakrefs_inspect`,e=>e.desc(`Enumerate WeakRef and FinalizationRegistry instances in the page via Runtime.evaluate. Inspects registered finalization callbacks and live WeakRef targets, reporting how many WeakRefs are dereferenced vs cleared and which FinalizationRegistry callbacks have pending entries. Useful for diagnosing cleanup logic in long-lived pages. Requires browser/page CDP context.`).number(`scanDepth`,`Prototype chain scan depth for WeakRef discovery (default: 5)`,{default:5}).query()),f(`v8_heap_snapshot_list`,e=>e.desc(`List V8 heap snapshots — both in-memory (current session) and persisted to artifacts/heap-snapshots/ (survive a server restart). Reports id, capture time, size, source (in-memory/persisted), simulated flag, and expiry status, plus aggregate stats. Snapshot payloads are NOT returned (only metadata).`).boolean(`includeExpired`,`Include ttl-expired persisted snapshots (default: false)`).number(`ttlMinutes`,`Mark persisted snapshots older than N minutes as expired (default: 0 = no ttl flagging)`).query()),f(`v8_heap_snapshot_delete`,e=>e.desc(`Delete persisted V8 heap snapshot artifact files (.heapsnapshot data + .meta.json sidecar) and drop the matching in-memory cache entry. Use deleteAll=true to remove every persisted snapshot. Does not affect the live V8 heap.`).string(`snapshotId`,`Snapshot ID to delete`).boolean(`deleteAll`,`Delete ALL persisted snapshots (snapshotId is ignored when true)`).destructive()),f(`v8_heap_snapshot_export`,e=>e.desc(`Export a heap snapshot as a complete .heapsnapshot JSON file under artifacts/heap-snapshots/, loadable by the Chrome DevTools Memory panel. The file path is returned; the snapshot content is written to disk, not injected into the response (it can be very large).`).string(`snapshotId`,`Snapshot ID to export (must be in-memory or persisted)`).required(`snapshotId`).query())],w=`.heapsnapshot`,T=`.meta.json`;function E(){return n(`heap-snapshots`)}function D(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`).replace(/_+/g,`_`).replace(/^_|_$/g,``).substring(0,120)}function O(e,t){return m(e,`${D(t)}${w}`)}function k(e,t){return m(e,`${D(t)}${T}`)}function A(t){let n=h(e(),t);return n&&!n.startsWith(`..`)&&!g(t).includes(`..`)?n.replace(/\\/g,`/`):t.replace(/\\/g,`/`)}async function ee(e){let t=E();await _(t,{recursive:!0});let n=e.id,r=O(t,n),i=k(t,n);await S(r,e.chunks.join(``),`utf8`);let a={id:n,capturedAt:e.capturedAt,sizeBytes:e.sizeBytes,chunkCount:e.chunks.length,simulated:e.simulated??!1,...typeof e.targetUrl==`string`?{targetUrl:e.targetUrl}:{}};await S(i,JSON.stringify(a),`utf8`);let o=e.sizeBytes;try{o=(await x(r)).size}catch{}return{meta:a,absolutePath:r,metaPath:i,displayPath:A(r),bytesWritten:o}}async function j(e){let t=E(),n=e?.now??Date.now(),r=e?.ttlMs??0,i;try{i=await y(t,{withFileTypes:!0})}catch{return[]}let a=i.filter(e=>e.isFile()&&e.name.endsWith(T)),o=[];for(let e of a)try{let i=await v(m(t,e.name),`utf8`),a=JSON.parse(i);if(!a||typeof a.id!=`string`)continue;let s=Date.parse(a.capturedAt??``),c=r>0&&Number.isFinite(s)?n-s>r:!1;o.push({id:a.id,capturedAt:a.capturedAt??``,sizeBytes:typeof a.sizeBytes==`number`?a.sizeBytes:0,chunkCount:typeof a.chunkCount==`number`?a.chunkCount:0,simulated:a.simulated??!1,...typeof a.targetUrl==`string`?{targetUrl:a.targetUrl}:{},expired:c,fileName:e.name})}catch{}return o.sort((e,t)=>e.capturedAt<t.capturedAt?1:e.capturedAt>t.capturedAt?-1:0),o}async function M(e){let t=E(),n=O(t,e),r=k(t,e),i,a;try{i=await v(n,`utf8`),a=JSON.parse(await v(r,`utf8`))}catch{return null}return{id:a.id??e,chunks:[i],capturedAt:a.capturedAt??new Date().toISOString(),sizeBytes:a.sizeBytes??Buffer.byteLength(i,`utf8`)}}async function N(e){let t=E(),n=O(t,e),r=k(t,e),i=!1,a=0;for(let e of[n,r]){let t=0;try{t=(await x(e)).size}catch{continue}try{await b(e,{force:!0}),i=!0,a+=t}catch{}}return{deleted:i,freedBytes:a}}async function P(){let e=E(),t;try{t=await y(e,{withFileTypes:!0})}catch{return{deletedCount:0,freedBytes:0}}let n=t.filter(e=>e.isFile()&&e.name.endsWith(w)),r=0,i=0;for(let e of n){let t=await N(e.name.slice(0,-13));t.deleted&&(r+=1,i+=t.freedBytes)}return{deletedCount:r,freedBytes:i}}async function F(e){let t=e.maxCount??0,n=e.maxTotalBytes??0;if(t<=0&&n<=0)return{evictedIds:[],freedBytes:0};let r=(await j()).slice().toReversed(),i=[],a=0;if(t>0&&r.length>t){let e=r.slice(0,r.length-t);for(let t of e){let e=await N(t.id);e.deleted&&(i.push(t.id),a+=e.freedBytes)}r=r.slice(e.length)}if(n>0){let e=r.reduce((e,t)=>e+(t.sizeBytes??0),0),t=0;for(;t<r.length&&e>n;){let n=r[t],o=await N(n.id);o.deleted&&(i.push(n.id),a+=o.freedBytes),e-=n.sizeBytes??0,t+=1}}return{evictedIds:i,freedBytes:a}}const I=new Map;function L(){return I}function R(e){return I.set(e.id,e),e}function z(e){return I.get(e)}function B(){let e=process.env;return{maxCount:Math.max(0,parseInt(e.MCP_V8_HEAP_SNAPSHOT_MAX_COUNT??`0`,10)||0),maxTotalBytes:Math.max(0,parseInt(e.MCP_V8_HEAP_SNAPSHOT_MAX_TOTAL_MB??`0`,10)||0)*1024*1024}}function V(e){return typeof e==`object`&&!!e}function H(e){return V(e)&&typeof e.createCDPSession==`function`&&typeof e.evaluate==`function`}function U(e){return V(e)?`value`in e?U(e.value):`result`in e?U(e.result):e:e}async function W(e,t){return await e.send(`HeapProfiler.enable`).catch(()=>void 0),new Promise((n,r)=>{let i=0,a=e=>{let n=e?.chunk;typeof n==`string`&&(i+=Buffer.byteLength(n,`utf8`),t(n))};e.on?.(`HeapProfiler.addHeapSnapshotChunk`,a),e.send(`HeapProfiler.takeHeapSnapshot`,{reportProgress:!1}).then(()=>{e.off?.(`HeapProfiler.addHeapSnapshotChunk`,a),n(i)}).catch(t=>{e.off?.(`HeapProfiler.addHeapSnapshotChunk`,a),r(t)})})}async function G(e,t){let n=`snapshot_${Date.now().toString(36)}`,r=new Date().toISOString(),i=[],a=t.persist!==!1,o=null;if(a&&t.getTargetUrl)try{o=await t.getTargetUrl()}catch{o=null}let s={type:`page`,url:o,targetId:null},c=async(e,n,r)=>{t.setSnapshot(e.id);let s={success:!0,snapshotId:e.id,capturedAt:e.capturedAt,sizeBytes:e.sizeBytes,chunks:[],simulated:n,warnings:i,target:r};if(!a)return s;try{let t=await ee({id:e.id,chunks:e.chunks,capturedAt:e.capturedAt,sizeBytes:e.sizeBytes,simulated:n,targetUrl:o});I.set(e.id,{...e,...typeof o==`string`?{targetUrl:o}:{},persisted:{absolutePath:t.absolutePath,displayPath:t.displayPath}});let r=await F(B());return{...s,persisted:{displayPath:t.displayPath,bytesWritten:t.bytesWritten},...r.evictedIds.length>0?{evicted:r.evictedIds}:{}}}catch(e){return i.push(`heap snapshot persistence failed: ${e instanceof Error?e.message:String(e)}`),s}},l=t.resolver?.getAttachedTargetSession?.()??null;if(l)try{let e=[],i=await W(l,t=>{e.push(t)}),a=t.resolver?.getAttachedTargetInfo?.()??null,s={type:a?.type??null,url:a?.url??o,targetId:a?.targetId??null};return await c(R({id:n,chunks:e,capturedAt:r,sizeBytes:i,simulated:!1,...s.type?{targetType:s.type}:{},...s.targetId?{targetId:s.targetId}:{}}),!1,s)}catch(e){i.push(`Attached-target heap snapshot failed: ${e instanceof Error?e.message:String(e)}. Trying page fallback...`)}if(t.client)try{let e=[];return await c(R({id:n,chunks:e,capturedAt:r,sizeBytes:await t.client.takeHeapSnapshot(t=>{e.push(t)}),simulated:!1}),!1,s)}catch(e){i.push(`Direct CDP snapshot capture failed: ${e instanceof Error?e.message:String(e)}. Trying page-evaluate fallback...`)}try{let e=await t.getPage();if(H(e)){let t=await e.createCDPSession(),i=(e,n)=>t.send(e,n),a=()=>t.detach();await i(`HeapProfiler.enable`);let o=await i(`Runtime.evaluate`,{expression:`
2
+ (() => {
3
+ const m = performance.memory;
4
+ return m
5
+ ? {
6
+ jsHeapSizeUsed: m.usedJSHeapSize,
7
+ jsHeapSizeTotal: m.totalJSHeapSize,
8
+ jsHeapSizeLimit: m.jsHeapSizeLimit
9
+ }
10
+ : null;
11
+ })()
12
+ `,returnByValue:!0});await a().catch(()=>void 0);let l=U(o),u=typeof l==`string`?(()=>{try{return JSON.parse(l)}catch{return null}})():l,d=0;return V(u)&&typeof u.jsHeapSizeUsed==`number`&&(d=u.jsHeapSizeUsed),await c(R({id:n,chunks:[`{"simulated":true,"sizeBytes":${d}}`],capturedAt:r,sizeBytes:d,simulated:!0}),!0,s)}}catch(e){i.push(`Page-evaluate fallback failed: ${e instanceof Error?e.message:String(e)}`)}let u=0;try{let e=await t.getPage();if(e&&typeof e.evaluate==`function`){let t=await e.evaluate(()=>{let e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize??0,totalJSHeapSize:e.totalJSHeapSize??0,jsHeapSizeLimit:e.jsHeapSizeLimit??0}:null});t&&typeof t.usedJSHeapSize==`number`&&(u=t.usedJSHeapSize)}}catch(e){i.push(`performance.memory fallback failed: ${e instanceof Error?e.message:String(e)}`)}return await c(R({id:n,chunks:u>0?[`{"simulated":true,"approximateHeapSize":${u}}`]:[`{}`],capturedAt:r,sizeBytes:u,simulated:!0}),!0,s)}async function K(e,t){let n=o(e,`scriptId`,``).trim(),i=s(e,`functionOffset`),a=c(e,`includeSourceFallback`,!1);if(n.length===0)return{success:!1,error:`scriptId is required`};let l=new r(t?.getPage),u=await l.attemptNativeBytecodeExtraction(n,i??void 0);if(!u)return{success:!1,error:`Unable to inspect bytecode for scriptId "${n}"`};let d=await l.findHiddenClasses(n);if(u.available&&u.bytecode){let e={functionName:u.functionName,bytecode:u.bytecode,sourcePosition:u.sourcePosition};return{success:!0,scriptId:n,functionOffset:i??null,mode:`native`,bytecodeAvailable:!0,format:u.format,rawIgnitionBytecodeAvailable:u.rawIgnitionBytecodeAvailable,supportsNativesSyntax:u.supportsNativesSyntax,reason:u.reason,extraction:e,disassembly:l.disassembleBytecode(u.bytecode),hiddenClasses:d,sourceFallback:null}}let f=a?await l.extractBytecode(n,i??void 0):null;return{success:!0,scriptId:n,functionOffset:i??null,mode:f?`source-fallback`:`unavailable`,bytecodeAvailable:!1,format:null,rawIgnitionBytecodeAvailable:u.rawIgnitionBytecodeAvailable,supportsNativesSyntax:u.supportsNativesSyntax,reason:u.reason,extraction:null,disassembly:[],hiddenClasses:d,sourceFallback:f?{format:`pseudo-bytecode`,extraction:f,disassembly:l.disassembleBytecode(f.bytecode)}:null}}async function q(e,t){let n=o(e,`scriptId`,``).trim();if(n.length===0)return{success:!1,error:`scriptId is required`};let r=await new a(t?.getPage).inspectJIT(n);return{success:!0,scriptId:n,inspectionMode:r.inspectionMode,supportsNativesSyntax:r.supportsNativesSyntax,functions:r.functions}}function J(e){return{kind:`runtime-object`,source:`debugger-session`,propertyCount:e.length,properties:e}}function Y(e){let t=e.pageController;if(!t)throw Error(`PageController not available`);return t}function X(e){return new i(e.pageController?Z(e):void 0)}function Z(e){let t=Y(e);return async()=>await t.getPage()}function Q(e){let t=e.collector,n={getPage:e.pageController?Z(e):void 0};return t&&(n.getAttachedTargetSession=()=>t.getAttachedTargetSession()??null,n.getAttachedTargetInfo=()=>{let e=t.getAttachedTargetInfo();return e?{type:e.type??null,url:e.url??null,targetId:e.targetId??null}:null}),n}var $=class{deps;currentSnapshotId=null;constructor(e){this.deps=e}async handle(e,t){let n={v8_heap_snapshot_capture:e=>this.v8_heap_snapshot_capture(e),v8_heap_snapshot_analyze:e=>this.v8_heap_snapshot_analyze(e),v8_heap_diff:e=>this.v8_heap_diff(e),v8_object_inspect:e=>this.v8_object_inspect(e),v8_heap_stats:e=>this.v8_heap_stats(e),v8_bytecode_extract:e=>this.v8_bytecode_extract(e),v8_version_detect:e=>this.v8_version_detect(e),v8_jit_inspect:e=>this.v8_jit_inspect(e),v8_heap_find_leaks:e=>this.v8_heap_find_leaks(e),v8_heap_retainers:e=>this.v8_heap_retainers(e),v8_object_compare:e=>this.v8_object_compare(e),v8_wasm_inspect:e=>this.v8_wasm_inspect(e),v8_deopt_trace:e=>this.v8_deopt_trace(e),v8_turbofan_inspect:e=>this.v8_turbofan_inspect(e),v8_function_retained:e=>this.v8_function_retained(e),v8_turbofan_graph:e=>this.v8_turbofan_graph(e),v8_heap_sampling:e=>this.v8_heap_sampling(e),v8_allocation_track:e=>this.v8_allocation_track(e),v8_weakrefs_inspect:e=>this.v8_weakrefs_inspect(e),v8_heap_snapshot_list:e=>this.v8_heap_snapshot_list(e),v8_heap_snapshot_delete:e=>this.v8_heap_snapshot_delete(e),v8_heap_snapshot_export:e=>this.v8_heap_snapshot_export(e)}[e];if(!n)throw Error(`Unknown v8-inspector tool: ${e}`);return n(t)}async v8_deopt_trace(e){let{handleDeoptTrace:t}=await import(`./deopt-trace-qnAcC931.mjs`);return t(e,Q(this.deps.ctx))}async v8_turbofan_inspect(e){let{handleTurbofanInspect:t}=await import(`./turbofan-inspect--NdCuYXi.mjs`);return t(e,Q(this.deps.ctx))}async v8_turbofan_graph(e){let{handleTurbofanGraph:t}=await import(`./turbofan-graph-CbGHNVtl.mjs`);return t(e)}async v8_heap_sampling(e){return u(async()=>{Y(this.deps.ctx);let{handleHeapSampling:t}=await import(`./heap-sampling-BqdiU-5j.mjs`);return t(e,Q(this.deps.ctx))})}async v8_allocation_track(e){return u(async()=>{Y(this.deps.ctx);let{handleAllocationTrack:t}=await import(`./allocation-track-CiI-CnaI.mjs`);return t(e,Q(this.deps.ctx))})}async v8_weakrefs_inspect(e){return u(async()=>{Y(this.deps.ctx);let{handleWeakRefsInspect:t}=await import(`./weakrefs-inspect-CnhaF-rN.mjs`);return t(e,Q(this.deps.ctx))})}async v8_function_retained(e){return u(async()=>{let t=l(e,`snapshotId`),n=l(e,`pattern`),r=typeof e.maxResults==`number`?e.maxResults:50,i=typeof e.minRetainedSize==`number`&&e.minRetainedSize>=0?e.minRetainedSize:0,a=z(t);if(!a)throw Error(`Snapshot ${t} not found`);let{HeapSnapshotParser:o}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.c),{DominatorTreeBuilder:s}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.l),c=new o;c.feedChunk(a.chunks);let u=new s,d=u.buildDominatorTree(c.parseNodes(),c.parseEdges()),f=u.getRetainedByFunctionName(n,d,r,i);return{snapshotId:t,pattern:n,objects:f,objectCount:f.length}})}async v8_heap_snapshot_capture(e){return u(async()=>{Y(this.deps.ctx);let t=Z(this.deps.ctx),n=typeof e.persist==`boolean`?e.persist:!0,r=await G(e,{getPage:t,getSnapshot:()=>this.currentSnapshotId,setSnapshot:e=>{this.currentSnapshotId=e},client:this.deps.client,persist:n,resolver:Q(this.deps.ctx),getTargetUrl:n?async()=>{try{return(await t())?.url?.()??null}catch{return null}}:void 0});return r.success&&r.snapshotId&&this.deps.ctx.eventBus.emit(`v8:heap_captured`,{snapshotId:r.snapshotId,sizeBytes:r.sizeBytes,timestamp:r.capturedAt}),r})}async v8_heap_snapshot_list(e){return u(async()=>{let t=typeof e.includeExpired==`boolean`?e.includeExpired:!1,n=typeof e.ttlMinutes==`number`&&e.ttlMinutes>0?e.ttlMinutes:0,r=n>0?n*6e4:0,i=L(),a=await j(r>0?{ttlMs:r}:{}),o=new Map(a.map(e=>[e.id,e])),s=new Set,c=[],l=0;for(let[e,n]of i){s.add(e);let r=o.get(e),i=r?.expired??!1;if(!t&&i)continue;let a={id:e,capturedAt:n.capturedAt,sizeBytes:n.sizeBytes,simulated:n.simulated,inMemory:!0,persisted:!!n.persisted||r!==void 0,expired:i,...n.targetUrl!==null||r?.targetUrl!==null?{targetUrl:n.targetUrl??r?.targetUrl??null}:{},...n.persisted?.displayPath?{displayPath:n.persisted.displayPath}:{}};c.push(a),l+=n.sizeBytes}for(let e of a){if(s.has(e.id)||!t&&e.expired)continue;let n={id:e.id,capturedAt:e.capturedAt,sizeBytes:e.sizeBytes,simulated:e.simulated,inMemory:!1,persisted:!0,expired:e.expired,...e.targetUrl===null?{}:{targetUrl:e.targetUrl}};c.push(n),l+=e.sizeBytes}c.sort((e,t)=>e.capturedAt<t.capturedAt?1:e.capturedAt>t.capturedAt?-1:0);let u=c.filter(e=>e.inMemory).length,d=c.filter(e=>e.persisted).length,f=a.filter(e=>e.expired&&!s.has(e.id)).length;return{snapshots:c,count:c.length,totalBytes:l,expiredCount:t?a.filter(e=>e.expired).length:f,inMemoryCount:u,persistedCount:d}})}async v8_heap_snapshot_delete(e){return u(async()=>{if(typeof e.deleteAll==`boolean`&&e.deleteAll){let e=await P(),t=L(),n=0;for(let[e,r]of t)r.persisted&&(t.delete(e),n+=1);return{deleteAll:!0,deletedCount:e.deletedCount,freedBytes:e.freedBytes,cacheEntriesDropped:n}}let t=l(e,`snapshotId`),n=await N(t),r=L(),i=!1;return r.has(t)&&(r.delete(t),i=!0),{snapshotId:t,deleted:n.deleted,freedBytes:n.freedBytes,cacheDropped:i}})}async v8_heap_snapshot_export(e){return u(async()=>{let n=l(e,`snapshotId`),r,i=z(n);if(i)r=i.chunks;else{let e=await M(n);if(!e)throw Error(`Snapshot ${n} not found (in-memory or persisted)`);r=e.chunks}let{absolutePath:a,displayPath:o}=await t({category:`heap-snapshots`,toolName:`v8_heap_snapshot_export`,target:n,ext:`heapsnapshot`}),s=r.join(``),{writeFile:c}=await import(`node:fs/promises`);return await c(a,s,`utf8`),{snapshotId:n,absolutePath:a,displayPath:o,sizeBytes:Buffer.byteLength(s,`utf8`)}})}async v8_heap_snapshot_analyze(e){return u(async()=>{let t=l(e,`snapshotId`),n=z(t);if(!n)throw Error(`Snapshot ${t} not found`);let r=typeof e.includeDominatorTree==`boolean`?e.includeDominatorTree:!1,i=typeof e.depth==`number`&&e.depth>0?e.depth:3,a=typeof e.includeLeakDetection==`boolean`?e.includeLeakDetection:!1,o=typeof e.minLeakSize==`number`&&e.minLeakSize>0?e.minLeakSize:1024*1024,{HeapSnapshotParser:s}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.c),c=new s;c.feedChunk(n.chunks);let u=await c.analyzeHeap(t,{includeDominatorTree:r,dominatorTreeDepth:i,includeLeakDetection:a,minLeakSize:o}),d=typeof e.topN==`number`&&e.topN>0?e.topN:50,f={snapshotId:t,summary:{chunkCount:n.chunks.length,sizeBytes:n.sizeBytes,totalObjects:u.statistics.totalObjects,detachedDOMNodes:u.statistics.detachedDOMNodes},classHistogram:u.classHistogram.slice(0,d),parseTimeMs:u.metadata.parseTimeMs};return u.dominatorTree&&(f.dominatorTree=u.dominatorTree),u.suspectedLeaks&&(f.suspectedLeaks=u.suspectedLeaks),f})}async v8_heap_diff(e){return u(async()=>{let t=typeof e.beforeSnapshotId==`string`?e.beforeSnapshotId:void 0,n=typeof e.afterSnapshotId==`string`?e.afterSnapshotId:void 0;if(!t||!n)throw Error(`Both beforeSnapshotId and afterSnapshotId are required`);let r=z(t);if(!r)throw Error(`Snapshot ${t} not found`);let i=z(n);if(!i)throw Error(`Snapshot ${n} not found`);let a=typeof e.topN==`number`&&e.topN>0?e.topN:50,{HeapSnapshotParser:o}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.c),s=Date.now(),c=new o;c.feedChunk(r.chunks);let l=new o;l.feedChunk(i.chunks);let u=c.diff(l),d=Date.now()-s,f=[...u.added].toSorted((e,t)=>t.selfSize-e.selfSize),p=[...u.removed].toSorted((e,t)=>t.selfSize-e.selfSize);return{beforeSnapshotId:t,afterSnapshotId:n,sizeDeltaBytes:i.sizeBytes-r.sizeBytes,sizeDelta:u.sizeDelta,addedCount:u.added.length,removedCount:u.removed.length,added:f.slice(0,a).map(e=>({id:e.id,name:e.name,selfSize:e.selfSize,type:e.type})),removed:p.slice(0,a).map(e=>({id:e.id,name:e.name,selfSize:e.selfSize,type:e.type})),parseTimeMs:d}})}async v8_object_inspect(e){return u(async()=>{let t=l(e,`address`),n=await this.inspectObjectViaDebugger(t),r;if(!n)try{n=await this.deps.client.getObjectByObjectId(t)??void 0}catch(e){r=e instanceof Error?e.message:String(e)}if(!n)throw Error(r?`Could not inspect object ${t}: ${r}`:`Could not inspect object ${t}: no data from debugger or Runtime`);return{address:t,objectData:n}})}async v8_heap_stats(e){return u(async()=>{Y(this.deps.ctx);let e,t=[];try{e=await this.deps.client.getHeapUsage()}catch(e){t.push(`heapUsage unavailable: ${e instanceof Error?e.message:String(e)}`)}return{snapshotCount:L().size,...e?{heapUsage:e}:{},...t.length>0?{warnings:t}:{}}})}async v8_bytecode_extract(e){return K(e,{getPage:this.deps.ctx.pageController?Z(this.deps.ctx):void 0})}async v8_version_detect(e){return u(async()=>{if(!this.deps.ctx.pageController)throw Error(`v8_version_detect: PageController not available. Call browser_launch or browser_attach first.`);let{VersionDetector:e}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.o),t=new e(Z(this.deps.ctx));return{version:await t.detectV8Version(),features:{nativesSyntax:await t.supportsNativesSyntax()}}})}async v8_jit_inspect(e){return q(e,{getPage:this.deps.ctx.pageController?Z(this.deps.ctx):void 0})}async v8_heap_find_leaks(e){return u(async()=>{let t=l(e,`snapshotId`),n=z(t);if(!n)throw Error(`Snapshot ${t} not found`);let r=typeof e.minRetainedSize==`number`&&e.minRetainedSize>0?e.minRetainedSize:1024*1024,i=typeof e.maxResults==`number`&&e.maxResults>0?e.maxResults:20,{HeapSnapshotParser:a}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.c),{DominatorTreeBuilder:o}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.l),s=new a;s.feedChunk(n.chunks);let c=s.parseNodes(),u=s.parseEdges(),d=new o,f=d.buildDominatorTree(c,u),p=d.findLeakCandidates(f,r);return{snapshotId:t,leakCandidates:p.slice(0,i).map(e=>({nodeId:e.nodeId,name:e.name,reason:e.reason,confidence:e.confidence,retainedSize:e.retainedSize,shallowSize:e.shallowSize,path:e.path})),totalCandidates:p.length}})}async v8_heap_retainers(e){return u(async()=>{let t=l(e,`snapshotId`),n=z(t);if(!n)throw Error(`Snapshot ${t} not found`);let r=Array.isArray(e.nodeIds)?e.nodeIds.filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>0):[];if(r.length===0)throw Error(`nodeIds must be a non-empty array of positive integers`);if(r.length>100)throw Error(`nodeIds must contain at most 100 entries`);let i=typeof e.maxSteps==`number`&&e.maxSteps>0&&e.maxSteps<=200?e.maxSteps:50,{HeapSnapshotParser:a}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.c),{DominatorTreeBuilder:o}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.l),s=new a;s.feedChunk(n.chunks);let c=s.parseNodes(),u=s.parseEdges(),d=new o;d.buildDominatorTree(c,u);let f=d.getRetainerChains(r,i),p=0;for(let e of Object.values(f))p+=e.length;return{snapshotId:t,chains:f,chainCount:Object.keys(f).length,totalTraced:p}})}async v8_wasm_inspect(e){return u(async()=>{let t=typeof e.scriptId==`string`&&e.scriptId.length>0?e.scriptId:void 0,n=typeof e.includeStructs==`boolean`?e.includeStructs:!0;if(!this.deps.ctx.pageController)return{success:!1,modules:[],totalModules:0,wasmScripts:[],summary:{totalWasmModules:0,gcModules:0,nonGcModules:0,hasGcFeature:!1,hasThreadsFeature:!1,hasSimdFeature:!1},wasmGcAvailable:!1,error:`PageController not available. Call browser_launch or browser_attach first.`};let r=Q(this.deps.ctx),i=r.getAttachedTargetSession?.()??null,a;if(i)a=p(i);else{let e=await r.getPage?.();if(!e)throw Error(`No active page. Call browser_launch or browser_attach first.`);a=e}let{inspectWasmGc:o}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.a),s=await o(a,{scriptId:t,includeStructs:n});return{success:s.success,modules:s.modules,totalModules:s.totalModules,wasmScripts:s.wasmScripts,summary:s.summary,wasmGcAvailable:s.wasmGcAvailable,...n&&s.structs.length>0?{structs:s.structs}:{}}})}async v8_object_compare(e){return u(async()=>{let t=Array.isArray(e.objectIds)?e.objectIds.filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>0):null;if(!t||t.length===0)throw Error(`objectIds must be a non-empty array of positive integers`);if(t.length>50)throw Error(`objectIds must contain at most 50 entries`);let n=typeof e.anotherSnapshotId==`string`&&e.anotherSnapshotId.length>0?e.anotherSnapshotId:void 0,r=n&&Array.isArray(e.anotherObjectIds)?e.anotherObjectIds.filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>0):void 0;if(n&&!r)throw Error(`anotherObjectIds is required when anotherSnapshotId is provided`);if(r&&r.length!==t.length)throw Error(`anotherObjectIds must have the same length as objectIds (${t.length}), got ${r.length}`);let i=l(e,`snapshotId`),a=z(i);if(!a)throw Error(`Snapshot ${i} not found`);if(n&&!z(n))throw Error(`Snapshot ${n} not found`);let o=typeof e.minDeltaBytes==`number`&&e.minDeltaBytes>=0?e.minDeltaBytes:1024,{HeapSnapshotParser:s}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.c),{DominatorTreeBuilder:c}=await import(`./v8-inspector-CTJo08-K.mjs`).then(e=>e.l),u=new s;u.feedChunk(a.chunks);let d=u.parseNodes(),f=u.parseEdges(),p=new Map;for(let e of d)p.set(e.id,{name:e.name,selfSize:e.selfSize});let m=new Map;try{(function e(t){m.set(t.nodeId,t.retainedSize);for(let n of t.children)e(n)})(new c().buildDominatorTree(d,f))}catch{for(let e of d)m.set(e.id,e.selfSize)}let h=new Map;for(let e of f)h.set(e.fromId,(h.get(e.fromId)??0)+1);let g,_,v,y;if(n){let e=z(n),t=new s;t.feedChunk(e.chunks),g=t.parseNodes();let r=t.parseEdges();_=new Map;try{(function e(t){_.set(t.nodeId,t.retainedSize);for(let n of t.children)e(n)})(new c().buildDominatorTree(g,r))}catch{for(let e of g)_.set(e.id,e.selfSize)}v=new Map;for(let e of r)v.set(e.fromId,(v.get(e.fromId)??0)+1);y=new Map;for(let e of g)y.set(e.id,{name:e.name,selfSize:e.selfSize})}let b=[];function x(e,t,n,r){let i=t.get(e);return i?{nodeId:e,name:i.name,shallowSize:i.selfSize,retainedSize:n.get(e)??i.selfSize,propertyCount:r.get(e)??0}:(b.push(e),null)}let S=[];if(r&&g&&_&&v&&y)for(let e=0;e<t.length;e++){let n=x(t[e],p,m,h),i=x(r[e],y,_,v);if(!n||!i)continue;let a=n.name===i.name;S.push({objectA:n,objectB:i,delta:{shallowSize:i.shallowSize-n.shallowSize,retainedSize:i.retainedSize-n.retainedSize,propertyCount:i.propertyCount-n.propertyCount},classMatch:a,sameClass:a,interesting:Math.abs(i.shallowSize-n.shallowSize)>=o||Math.abs(i.retainedSize-n.retainedSize)>=o||!a})}else{let e=[];for(let n of t){let t=x(n,p,m,h);t&&e.push(t)}let n=e.length===1;for(let t=0;t<e.length;t++)for(let r=n?t:t+1;r<e.length;r++){let n=e[t],i=e[r],a=n.name===i.name,s=i.shallowSize-n.shallowSize,c=i.retainedSize-n.retainedSize;S.push({objectA:n,objectB:i,delta:{shallowSize:s,retainedSize:c,propertyCount:i.propertyCount-n.propertyCount},classMatch:a,sameClass:a,interesting:Math.abs(s)>=o||Math.abs(c)>=o||!a})}}return S.sort((e,t)=>Math.abs(t.delta.retainedSize)-Math.abs(e.delta.retainedSize)),{snapshotId:i,...n?{anotherSnapshotId:n}:{},pairs:S,...b.length>0?{skippedNodes:b}:{},pairCount:S.length}})}async inspectObjectViaDebugger(e){let t=this.deps.ctx.debuggerManager;if(!(!t||typeof t.getObjectPropertiesById!=`function`))try{let n=await t.getObjectPropertiesById(e);return Array.isArray(n)?J(n):void 0}catch{return}}};const te=C.map(e=>({tool:e,domain:`v8-inspector`,bind:d(`v8InspectorHandlers`,(t,n)=>t.handle(e.name,n))}));async function ne(e){let t=new $({ctx:e,client:X(e)});return e.v8InspectorHandlers=t,t}const re={kind:`domain-manifest`,version:1,domain:`v8-inspector`,depKey:`v8InspectorHandlers`,profiles:[`workflow`,`full`],registrations:te,ensure:ne,prerequisites:{v8_heap_snapshot_capture:[{condition:`Browser must be connected`,fix:`Call browser_launch or browser_attach first`}],v8_heap_snapshot_analyze:[{condition:`A snapshotId must be provided`,fix:`Capture a heap snapshot before analysis`}],v8_heap_diff:[{condition:`Both snapshot identifiers are required`,fix:`Capture before/after snapshots before diffing`}]},toolDependencies:[{from:`v8_heap_snapshot_capture`,to:`browser_attach`,relation:`requires`,weight:.8},{from:`v8_object_inspect`,to:`v8_heap_snapshot_analyze`,relation:`precedes`,weight:.6}],workflowRule:{patterns:[/v8.*heap/i,/heap.*snapshot/i,/jit/i,/object.*address/i],priority:80,tools:[`v8_heap_snapshot_capture`,`v8_heap_snapshot_analyze`,`v8_object_inspect`,`v8_heap_stats`],hint:`Capture a heap snapshot, analyze it, then inspect interesting objects by address.`}};export{$ as V8InspectorHandlers,re as default};
@@ -0,0 +1 @@
1
+ import{K as e,U as t}from"./constants-nvsLpSri.mjs";import{t as n}from"./registry-DJDnkQW2.mjs";import{n as r}from"./bind-helpers-D0mGAOof.mjs";import{t as i}from"./tool-builder-CpLh-UQd.mjs";import{t as a}from"./reverseEngineeringConfig-BhZLOa3C.mjs";const o=[i(`apk_packer_detect`,e=>e.desc("Detect Android APK packers by matching `lib/<abi>/lib*.so` filenames against user-supplied customSignatures (ReDoS-guarded regex compilation). The framework ships no built-in signature table — callers provide their own. **Does not unpack, execute, or otherwise interact with packed code.**").string(`apkPath`,`Absolute path to the .apk (or .aab) file to inspect`).string(`dirPath`,`Optional path to a directory containing an already-unpacked APK tree`).enum(`ruleMode`,[`append`,`prepend`,`replace`],`How customSignatures interact with the default (empty) signature table`,{default:`append`}).array(`customSignatures`,{type:`object`,properties:{name:{type:`string`,description:`Display name of the fingerprint entry`},category:{type:`string`,description:`Optional free-form category label supplied by the caller`},libPatterns:{type:`array`,items:{type:`string`},description:`lib basenames or anchored regex sources (case-insensitive; ReDoS-guarded)`},confidence:{type:`string`,enum:[`high`,`medium`,`low`],description:`Optional single-hit confidence hint (default: medium)`},notes:{type:`string`,description:`Free-form notes surfaced in list-signatures`}},required:[`name`,`libPatterns`]},`Fingerprints supplied by the caller. Compile-time and runtime ReDoS guards apply.`).query()),i(`apk_packer_list_signatures`,e=>e.desc("List the in-process signature table used by `apk_packer_detect`. Empty by default; reflects caller-managed state at request time. Optionally filter by case-insensitive category substring.").string(`category`,`Optional case-insensitive category substring filter`).query()),i(`apk_signing_block_parse`,e=>e.desc(`Read-only parser for the APK Signing Block (schemes v2/v3/v3.1/v4) plus key-rotation lineage detection and residue-block / dex-prefix / magic-offset anomaly flags. Never mutates the APK.`).string(`apkPath`,`Absolute path to the .apk file to parse`).required(`apkPath`).query())],s=[i(`binary_key_extract`,e=>e.desc(`Scan a binary for hardcoded key candidates (raw high-entropy, Base64, hex). Read-only — no decryption.`).string(`filePath`,`Absolute path to the binary file to scan`).array(`keyLengths`,{type:`integer`,minimum:1,maximum:4096},`Decoded byte lengths to accept (default: [16, 24, 32, 64])`).number(`minEntropy`,`Inclusive minimum Shannon entropy for raw windows (0..8)`,{minimum:0,maximum:8}).array(`formats`,{type:`string`,enum:[`raw`,`base64`,`hex`]},`Which candidate formats to emit (default: all three)`).boolean(`includeContext`,`Attach a hex+ASCII context window to each candidate`,{default:!0}).integer(`contextBytes`,`Context window size on each side, in bytes (0..1024)`,{minimum:0,maximum:1024,default:16}).integer(`maxResults`,"Cap on returned candidates; excess sets `truncated:true`",{minimum:1}).integer(`maxChunkBytes`,`Streaming chunk size in bytes`).object(`scanWindow`,{start:{type:`integer`,minimum:0,description:`Inclusive start byte offset`},end:{type:`integer`,minimum:1,description:`Exclusive end byte offset`}},`Restrict scanning to a byte range (skip ELF headers, focus on a section, etc.)`).required(`filePath`).query())],c=a(),l=c.apk,u=c.dex,d=c.frida,f=[i(`binary_instrument_capabilities`,e=>e.desc(`Report binary instrumentation backend availability.`).query()),i(`frida_attach`,e=>e.desc(`Attach Frida to a local target and open a session.`).string(`target`,`Process name, PID, or binary path to attach to`).required(`target`)),i(`frida_spawn`,e=>e.desc(`Spawn a target through Frida for early instrumentation before normal execution.`).string(`target`,`Package name or binary path to spawn with Frida -f`).required(`target`)),i(`frida_enumerate_modules`,e=>e.desc(`List loaded modules in an attached Frida session.`).string(`sessionId`,`Session id returned by frida_attach`).required(`sessionId`).query()),i(`ghidra_analyze`,e=>e.desc(`Analyze a binary and return metadata.`).string(`binaryPath`,`Path to the binary file`).number(`timeout`,`Optional timeout in milliseconds for headless analysis`).required(`binaryPath`)),i(`generate_hooks`,e=>e.desc(`Generate a Frida interceptor script for a list of symbols.`).array(`symbols`,{type:`string`},`Symbol names to hook`).object(`options`,{includeArgs:{type:`boolean`,description:`Emit argument logging on function entry`},includeRetAddr:{type:`boolean`,description:`Emit return-address logging on function entry`}},`Optional Frida hook generation flags`).required(`symbols`)),i(`unidbg_emulate`,e=>e.desc(`Emulate a native function with Unidbg when available.`).string(`binaryPath`,`Path to the binary file`).string(`functionName`,`Function name to emulate`).array(`args`,{type:`string`},`Optional string arguments forwarded to emulation`).required(`binaryPath`,`functionName`)),i(`frida_run_script`,e=>e.desc(`Execute a Frida JavaScript snippet inside an attached Frida session.`).string(`sessionId`,`Session id returned by frida_attach`).string(`script`,`Frida JavaScript to execute`).required(`sessionId`,`script`)),i(`frida_resume`,e=>e.desc(`Resume a target previously spawned for early Frida instrumentation.`).string(`sessionId`,`Session id returned by frida_spawn`).required(`sessionId`)),i(`frida_detach`,e=>e.desc(`Detach from a Frida session and clean up resources.`).string(`sessionId`,`Session id returned by frida_attach`).required(`sessionId`)),i(`frida_list_sessions`,e=>e.desc(`List all active Frida attach sessions with target info.`).query()),i(`frida_dex_dump`,e=>e.desc(`Run frida-dexdump as a high-level Android DEX dump helper by package/process name or PID.`).string(`target`,`Package/process name for -n, for example com.example.app.`).number(`pid`,`Optional process id for -p. Overrides target when provided.`).string(`outputDir`,`Required output directory for dumped DEX files.`).boolean(`usb`,`Use USB device mode (-U).`,{default:!0}).number(`timeoutMs`,`Optional timeout in milliseconds.`,{default:d.dexDumpTimeoutMs}).required(`outputDir`)),i(`android_runtime_dump_session`,e=>e.desc(`Create or inspect a managed Android runtime dump session from Frida/ADB dump artifacts, DEX files, and /proc/PID/maps snapshots.`).string(`action`,`Session action: start, status, or list. Defaults to start.`).string(`packageName`,`Android package name for the runtime target.`).number(`pid`,`Runtime process id when known.`).string(`outputDir`,`Directory containing dumped DEX/CDEX artifacts for action=start.`).string(`mapsPath`,`Optional local file containing a /proc/PID/maps snapshot.`).string(`sessionId`,`Session id for action=status.`).number(`maxDexFiles`,`Maximum dumped DEX/CDEX files to summarize.`,{default:u.artifactDefaultLimit}).number(`maxDexFileBytes`,`Maximum bytes to read from each dumped DEX/CDEX file.`,{default:u.artifactDefaultMaxFileBytes}).number(`maxTotalDexBytes`,`Maximum total dumped DEX/CDEX bytes to read.`,{default:u.artifactDefaultMaxTotalBytes}).number(`maxMapsBytes`,`Maximum bytes to read from the maps snapshot.`).number(`maxMapsModules`,`Maximum distinct mapped module paths to return.`).query()),i(`frida_generate_script`,e=>e.desc(`Generate a Frida interceptor or hook script from built-in templates.`).string(`target`,`Target binary or module name`).string(`template`,`Hook template type: trace, intercept, replace, log`).string(`functionName`,`Function name to generate hook for`).string(`moduleName`,`Optional module name for Module.findExportByName`).string(`address`,`Optional absolute address expression used as ptr(address)`).array(`argSpec`,{type:`object`,description:`Argument descriptor: {index?:number,name?:string,type?:string}`},`Optional argument descriptors to log in the interceptor body.`).string(`onEnterBody`,`Optional custom Frida JavaScript inserted into onEnter(args)`).string(`onLeaveBody`,`Optional custom Frida JavaScript inserted into onLeave(retval)`).required(`target`,`template`)),i(`frida_attach_interceptor`,e=>e.desc(`Generate a real Frida Interceptor.attach block for a symbol and optionally install it in a session.`).string(`symbol`,`Exported symbol or function name to intercept`).string(`moduleName`,`Optional module name for Module.findExportByName`).string(`address`,`Optional absolute address expression used as ptr(address)`).array(`argSpec`,{type:`object`,description:`Argument descriptor: {index?:number,name?:string,type?:string}`},`Optional argument descriptors to log in the interceptor body.`).string(`onEnterBody`,`Optional custom Frida JavaScript inserted into onEnter(args)`).string(`onLeaveBody`,`Optional custom Frida JavaScript inserted into onLeave(retval)`).boolean(`install`,`Run the generated script in the supplied Frida session.`,{default:!1}).string(`sessionId`,`Required when install=true; session from frida_attach or frida_spawn`).required(`symbol`)),i(`get_available_plugins`,e=>e.desc(`List installed binary analysis plugins.`).query()),i(`ghidra_decompile`,e=>e.desc(`Decompile a function using Ghidra.`).string(`binaryPath`,`Path to the binary file`).string(`functionName`,`Function name to decompile`).required(`binaryPath`,`functionName`)),i(`ida_decompile`,e=>e.desc(`Decompile a function using IDA Pro.`).string(`binaryPath`,`Path to the binary file`).string(`functionName`,`Function name to decompile`).required(`binaryPath`,`functionName`)),i(`jadx_decompile`,e=>e.desc(`Decompile an APK class or method with JADX CLI.`).string(`apkPath`,`Path to the APK file`).string(`className`,`Fully qualified class name`).string(`methodName`,`Method name to decompile`).required(`apkPath`,`className`)),i(`jadx_decompile_apk`,e=>e.desc(`High-level JADX APK decompile: decompile the whole APK to a stable output directory and return sourcesDir for jadx_search_code.`).string(`apkPath`,`Path to the APK, DEX, or CDEX file`).string(`outputDir`,`Optional output directory. Defaults to a temp directory.`).boolean(`noResources`,`Skip resources with --no-res.`,{default:!1}).boolean(`force`,`Clear outputDir before decompilation if it exists.`,{default:!1}).required(`apkPath`)),i(`apktool_decode`,e=>e.desc(`Decode an APK using apktool to inspect resources, manifest, and smali output.`).string(`apkPath`,`Path to the APK file`).string(`outputDir`,`Optional output directory for decoded contents`).boolean(`force`,`Overwrite output directory if it already exists`,{default:!1}).required(`apkPath`)),i(`apktool_build`,e=>e.desc(`Rebuild an APK from a decoded apktool source directory (closes the patch-and-repack loop with apk_sign).`).string(`sourceDir`,`Path to the decoded apktool source directory`).string(`outputPath`,`Optional output APK path (defaults to sourceDir/dist/*.apk)`).boolean(`force`,`Force build, overwriting any previous build output`,{default:!1}).required(`sourceDir`)),i(`apk_sign`,e=>e.desc(`Sign an APK with apksigner using a caller-supplied keystore. Pairs with apktool_build for a full repack-and-sign workflow.`).string(`apkPath`,`Path to the APK file to sign`).string(`keystore`,`Path to the keystore (.jks/.keystore). Required — without it the tool honestly refuses rather than silently debug-signing.`).string(`keystorePassword`,`Keystore password`).string(`keyAlias`,`Key alias inside the keystore`).string(`keyPassword`,`Password for the key (defaults to keystorePassword when omitted)`).string(`outputPath`,`Optional signed output APK path (defaults to in-place signing)`).required(`apkPath`)),i(`apk_manifest_dump`,e=>e.desc(`Extract AndroidManifest.xml from an APK for quick inspection.`).string(`apkPath`,`Path to the APK file`).required(`apkPath`)),i(`apk_manifest_query`,e=>e.desc(`Return a compact structured AndroidManifest summary: package, launcher activity, app class, SDKs, permissions, components, providers, and SDK/surface hints.`).string(`apkPath`,`Path to the APK file`).boolean(`includeRawManifest`,`Include decoded manifest XML in the response.`,{default:!1}).array(`customSurfaceHints`,{type:`object`,description:`Caller-supplied literal surface hint rule: {name, patterns:string[], kind?:"protector"|"sdk"}. Patterns are substring matches, not regex.`},`Optional caller-supplied hint rules. No rule table is bundled by this parameter.`).required(`apkPath`).query()),i(`apk_static_triage`,e=>e.desc(`One-shot APK triage: ZIP metadata, manifest summary, native libs, asset hints, likely packers/protectors, and recommended next steps.`).string(`apkPath`,`Path to the APK file`).number(`maxEntries`,`Maximum ZIP entries to summarize.`,{default:l.staticTriageDefaultEntries}).array(`customSurfaceHints`,{type:`object`,description:`Caller-supplied literal surface hint rule: {name, patterns:string[], kind?:"protector"|"sdk"}. Patterns are substring matches, not regex.`},`Optional caller-supplied hint rules. No rule table is bundled by this parameter.`).required(`apkPath`).query()),i(`apk_dex_intake`,e=>e.desc(`Build a cohesive APK/DEX intake evidence packet: ZIP entries, manifest summary, DEX headers, native libraries, generic surface hints, caller-supplied hint matches, and next actions.`).string(`apkPath`,`Path to the APK file`).number(`maxEntries`,`Maximum ZIP entries to include in the evidence packet.`,{default:l.staticTriageDefaultEntries}).number(`maxDexFiles`,`Maximum DEX/CDEX entries to read and summarize.`,{default:l.dexIntakeDefaultDexFiles}).number(`maxDexBytes`,`Maximum bytes to read from each DEX/CDEX entry.`,{default:u.artifactDefaultMaxFileBytes}).number(`maxTotalDexBytes`,`Maximum total DEX/CDEX bytes to read from the APK.`,{default:u.artifactDefaultMaxTotalBytes}).boolean(`includeRawManifest`,`Include decoded manifest XML in the response.`,{default:!1}).array(`customSurfaceHints`,{type:`object`,description:`Caller-supplied literal surface hint rule: {name, patterns:string[], kind?:"protector"|"sdk"}. Patterns are substring matches, not regex.`},`Optional caller-supplied hint rules. No rule table is bundled by this parameter.`).required(`apkPath`).query()),i(`dex_scan_file`,e=>e.desc(`Scan a binary/memory-dump file for DEX or CompactDex magic and optionally extract hits.`).string(`filePath`,`Path to a binary, memory dump, DEX, CDEX, VDEX, or APK-extracted blob.`).string(`outputDir`,`Optional output directory for extracted DEX/CDEX hits.`).number(`maxHits`,`Maximum DEX/CDEX headers to report.`,{default:u.scanDefaultMaxHits}).boolean(`extract`,`Write discovered hits to outputDir when file sizes are plausible.`,{default:!1}).required(`filePath`).query()),i(`binary_strings_extract`,n=>n.desc(`Extract printable ASCII/UTF-16LE strings from a binary file with regex filtering.`).string(`filePath`,`Path to the binary file.`).number(`minLength`,`Minimum string length.`,{default:e}).number(`maxResults`,`Maximum strings to return.`,{default:t}).string(`pattern`,`Optional JavaScript regex filter.`).required(`filePath`).query()),i(`binary_entropy_profile`,e=>e.desc(`Compute Shannon entropy across fixed-size chunks of a binary file to locate encrypted / packed / compressed sections. High-entropy regions (>=7.0 bits/byte) are likely encrypted or compressed; low-entropy (<4.0) are typically code or text. Pure-compute, no external tools.`).string(`filePath`,`Path to the binary file.`).number(`chunkSize`,`Bytes per entropy sample. Default 256.`,{default:256,minimum:64,maximum:65536}).number(`maxChunks`,`Maximum chunks to analyze (caps large files). Default 2000.`,{default:2e3,minimum:1,maximum:5e4}).required(`filePath`).query()),i(`apk_native_libs_list`,e=>e.desc(`List packaged native shared libraries (.so) inside an APK.`).string(`apkPath`,`Path to the APK file`).required(`apkPath`).query()),i(`unidbg_launch`,e=>e.desc(`Emulate a native shared library in Unidbg.`).string(`soPath`,`Path to the .so library file`).string(`arch`,`Architecture: arm or arm64`).required(`soPath`)),i(`unidbg_call`,e=>e.desc(`Call a JNI function in a running Unidbg emulator session.`).string(`sessionId`,`Session id from unidbg_launch`).string(`functionName`,`JNI function name to call`).required(`sessionId`,`functionName`)),i(`unidbg_trace`,e=>e.desc(`Get execution trace from Unidbg session with configurable detail.`).string(`sessionId`,`Session id from unidbg_launch`).required(`sessionId`)),i(`export_hook_script`,e=>e.desc(`Export generated hook templates as a complete, runnable Frida script.`).string(`hookTemplates`,`JSON array of hook template objects`)),i(`frida_enumerate_functions`,e=>e.desc(`Enumerate exported functions for a specific module in a Frida session.`).string(`sessionId`,`Session id returned by frida_attach`).string(`moduleName`,`Module name to enumerate exports from`).required(`sessionId`,`moduleName`).query()),i(`frida_find_symbols`,e=>e.desc(`Search for symbols matching a pattern in a Frida session.`).string(`sessionId`,`Session id returned by frida_attach`).string(`pattern`,`Symbol search pattern (e.g. "exports:*libssl*SSL*")`).required(`sessionId`,`pattern`).query()),i(`frida_memory_scan`,e=>e.desc(`Scan process memory for a byte pattern via Frida Memory.scanSync. Searches a named module, an explicit address range, or all readable ranges by default.`).string(`sessionId`,`Session id returned by frida_attach`).string(`pattern`,`Frida byte pattern, e.g. "DE AD BE EF" or "cafebabe"`).string(`moduleName`,`Optional module name to scope the scan to that module range.`).string(`address`,`Optional absolute start address (used with size) to scan an explicit range.`).number(`size`,`Optional number of bytes to scan when address is given.`).number(`max`,`Maximum matches to return (default 1000, capped at 10000).`).required(`sessionId`,`pattern`).query()),i(`frida_memory_read`,e=>e.desc(`Read raw bytes from a Frida session via ptr(address).readByteArray. Returns hex; capped at 65536 bytes per call.`).string(`sessionId`,`Session id returned by frida_attach`).string(`address`,`Absolute address to read from (hex or decimal)`).number(`size`,`Number of bytes to read (1-65536)`).required(`sessionId`,`address`,`size`).query()),i(`jadx_search_code`,e=>e.desc(`Ripgrep-backed search over jadx output. Pass decompileDir for read-only search, or apkPath to auto-decompile to a temporary directory first.`).string(`decompileDir`,`Absolute path to an existing jadx decompile output directory.`).string(`apkPath`,`Optional APK path. Used only when decompileDir is omitted.`).string(`query`,"Search query (regex unless `literal:true`)").boolean(`literal`,"Treat `query` as a literal string, not a regex",{default:!1}).boolean(`caseInsensitive`,`Case-insensitive matching`,{default:!1}).integer(`contextLines`,`Lines of context around each match`,{default:2,minimum:0,maximum:20}).integer(`maxMatchesPerFile`,`Cap on matches recorded per file`,{minimum:1}).integer(`maxResults`,`Hard ceiling on total matches across all files`,{minimum:1}).array(`globs`,{type:`string`,description:`Glob pattern (negative globs may start with !)`},"File globs applied during enumeration. Defaults to `**/*.java`, `**/*.kt`.").required(`query`).query()),...o,...s],p=`binary-instrument`,m=`binaryInstrumentHandlers`,h=r({domain:p,depKey:m,lookup:n(f),entries:[{tool:`binary_instrument_capabilities`,method:`handleBinaryInstrumentCapabilities`},{tool:`frida_attach`,method:`handleFridaAttach`},{tool:`frida_spawn`,method:`handleFridaSpawn`},{tool:`frida_enumerate_modules`,method:`handleFridaEnumerateModules`},{tool:`ghidra_analyze`,method:`handleGhidraAnalyze`},{tool:`generate_hooks`,method:`handleGenerateHooks`},{tool:`unidbg_emulate`,method:`handleUnidbgEmulate`},{tool:`frida_run_script`,method:`handleFridaRunScript`},{tool:`frida_resume`,method:`handleFridaResume`},{tool:`frida_detach`,method:`handleFridaDetach`},{tool:`frida_list_sessions`,method:`handleFridaListSessions`},{tool:`frida_dex_dump`,method:`handleFridaDexDump`},{tool:`android_runtime_dump_session`,method:`handleAndroidRuntimeDumpSession`},{tool:`frida_generate_script`,method:`handleFridaGenerateScript`},{tool:`frida_attach_interceptor`,method:`handleFridaAttachInterceptor`},{tool:`get_available_plugins`,method:`handleGetAvailablePlugins`},{tool:`ghidra_decompile`,method:`handleGhidraDecompile`},{tool:`ida_decompile`,method:`handleIdaDecompile`},{tool:`jadx_decompile`,method:`handleJadxDecompile`},{tool:`jadx_decompile_apk`,method:`handleJadxDecompileApk`},{tool:`jadx_search_code`,method:`handleJadxSearchCode`},{tool:`apktool_decode`,method:`handleApktoolDecode`},{tool:`apktool_build`,method:`handleApktoolBuild`},{tool:`apk_sign`,method:`handleApktoolSign`},{tool:`apk_manifest_dump`,method:`handleApkManifestDump`},{tool:`apk_manifest_query`,method:`handleApkManifestQuery`},{tool:`apk_static_triage`,method:`handleApkStaticTriage`},{tool:`apk_dex_intake`,method:`handleApkDexIntake`},{tool:`dex_scan_file`,method:`handleDexScanFile`},{tool:`binary_strings_extract`,method:`handleBinaryStringsExtract`},{tool:`binary_entropy_profile`,method:`handleBinaryEntropyProfile`},{tool:`apk_native_libs_list`,method:`handleApkNativeLibsList`},{tool:`unidbg_launch`,method:`handleUnidbgLaunch`},{tool:`unidbg_call`,method:`handleUnidbgCall`},{tool:`unidbg_trace`,method:`handleUnidbgTrace`},{tool:`export_hook_script`,method:`handleExportHookScript`},{tool:`frida_enumerate_functions`,method:`handleFridaEnumerateFunctions`},{tool:`frida_find_symbols`,method:`handleFridaFindSymbols`},{tool:`frida_memory_scan`,method:`handleFridaMemoryScan`},{tool:`frida_memory_read`,method:`handleFridaMemoryRead`}]}),g=r({domain:p,depKey:`apkPackerHandlers`,lookup:n(o),entries:[{tool:`apk_packer_detect`,method:`handleApkPackerDetect`},{tool:`apk_packer_list_signatures`,method:`handleApkPackerListSignatures`},{tool:`apk_signing_block_parse`,method:`handleApkSigningBlockParse`}]}),_=r({domain:p,depKey:`binarySecretsHandlers`,lookup:n(s),entries:[{tool:`binary_key_extract`,method:`handleBinaryKeyExtract`}]}),v=[...h,...g,..._];async function y(e){let{BinaryInstrumentHandlers:t}=await import(`./handlers-BxQv-wtf.mjs`),{GhidraAnalyzer:n,HookGenerator:r}=await import(`./binary-instrument-DiE1BP0x.mjs`).then(e=>e.t),i=e.getDomainInstance(m);if(i||(i=new t(e,new n,new r),e.setDomainInstance(m,i)),!e.getDomainInstance(`apkPackerHandlers`)){let{ApkPackerHandlers:t}=await import(`./handlers-oGo60aVv.mjs`);e.setDomainInstance(`apkPackerHandlers`,new t)}if(!e.getDomainInstance(`binarySecretsHandlers`)){let{BinarySecretsHandlers:t}=await import(`./handlers-CL0Iokmw.mjs`);e.setDomainInstance(`binarySecretsHandlers`,new t)}return i}const b={kind:`domain-manifest`,version:1,domain:p,depKey:m,secondaryDepKeys:[`apkPackerHandlers`,`binarySecretsHandlers`],profiles:[`full`],ensure:y,registrations:v,workflowRule:{patterns:[/\b(frida|ghidra|ida|unidbg|jadx|binary|disassemb|decompil|dump\s?so)\b/i,/(binary|native|so|dll|elf|apk).*(analyze|hook|instrument|decompile)/i,/(apk|android).*(manifest|apktool|native\s+libs|shared\s+library|\.so)/i,/(apk|android).*(triage|static|packer|protector|launcher|splash)/i,/(dex|cdex|vdex|binary|memory).*(scan|string|extract|dump)/i],priority:88,tools:[`ghidra_analyze`,`jadx_decompile`,`jadx_decompile_apk`,`apktool_decode`,`apk_manifest_dump`,`apk_manifest_query`,`apk_static_triage`,`apk_dex_intake`,`dex_scan_file`,`android_runtime_dump_session`,`binary_strings_extract`,`apk_native_libs_list`,`frida_attach`,`frida_spawn`,`frida_attach_interceptor`,`frida_resume`,`generate_hooks`,`unidbg_launch`],hint:`Binary analysis pipeline: start with apk_dex_intake for one evidence packet, then decompile/inspect APK, manifest, DEX files, and native libs → generate hook scripts → emulate with Unidbg when needed.`},prerequisites:{frida_attach:[{condition:`Frida CLI must be installed; device targets may also require frida-server and elevated privileges`,fix:`Install frida-tools and, for Android/device targets, launch frida-server on the target.`}],frida_spawn:[{condition:`Frida CLI must be installed; device targets may also require frida-server and spawn privileges`,fix:`Install frida-tools, start frida-server for device targets, and choose a spawnable package or executable.`}],frida_run_script:[{condition:`A Frida session must be active`,fix:`Call frida_attach before running a script`}],frida_resume:[{condition:`A Frida spawn session must be active`,fix:`Call frida_spawn first, install early hooks, then pass its sessionId to frida_resume.`}],frida_attach_interceptor:[{condition:`A Frida session is required when install=true`,fix:`Call frida_attach or frida_spawn first, or omit install to generate the script only.`}],ghidra_analyze:[{condition:`Ghidra analyzeHeadless must be installed and reachable on PATH`,fix:`Install Ghidra and ensure analyzeHeadless is on PATH.`}],ida_decompile:[{condition:`plugin_ida_bridge must be installed`,fix:`Install @jshookmcpextension/plugin-ida-bridge and provide IDA Pro license`}],jadx_decompile:[{condition:`jadx CLI or plugin_jadx_bridge must be available`,fix:`Install JADX and ensure jadx is on PATH, or install @jshookmcpextension/plugin-jadx-bridge.`}],apktool_decode:[{condition:`apktool CLI must be installed`,fix:`Install apktool and ensure it is on PATH.`}],unidbg_launch:[{condition:`Java 17+ and unidbg JAR must be reachable`,fix:`Install JDK 17+ and download unidbg from its official release`}],generate_hooks:[{condition:`Ghidra analysis output required`,fix:`Run ghidra_analyze first and pass the output to generate_hooks`}]},toolDependencies:[{from:`process`,to:`binary-instrument`,relation:`uses`,weight:.6}]};export{b as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";import{t as n}from"./definitions-C-6j3Ejl.mjs";const r=`process`,i=`processHandlers`,a=e(n),o=process.env.JSHOOK_REGISTRY_PLATFORM===`win32`||process.env.JSHOOK_REGISTRY_PLATFORM===`linux`||process.env.JSHOOK_REGISTRY_PLATFORM===`darwin`?process.env.JSHOOK_REGISTRY_PLATFORM:process.platform;async function s(e){let{ProcessToolHandlers:t}=await import(`./process-aDIfLC0v.mjs`);return e.processHandlers||=new t(e),e.processHandlers}const c=o===`win32`,l=new Set([`check_debug_port`,`process_enum_handles`,`process_detect_apc`]),u=t({domain:r,depKey:i,lookup:a,entries:[{tool:`process_find`,method:`handleProcessFindTool`},{tool:`process_list`,method:`handleProcessFindTool`},{tool:`process_get`,method:`handleProcessGetTool`},{tool:`process_kill`,method:`handleProcessKillTool`},{tool:`process_windows`,method:`handleProcessWindowsTool`},{tool:`process_check_debug_port`,method:`handleProcessCheckDebugPortTool`},{tool:`process_launch_debug`,method:`handleProcessLaunchDebugTool`},{tool:`electron_attach`,method:`handleElectronAttachTool`},{tool:`memory_read`,method:`handleMemoryReadTool`},{tool:`memory_write`,method:`handleMemoryWriteTool`},{tool:`memory_scan`,method:`handleMemoryScanTool`},{tool:`memory_check_protection`,method:`handleMemoryCheckProtectionTool`},{tool:`memory_scan_filtered`,method:`handleMemoryScanFilteredTool`},{tool:`memory_batch_write`,method:`handleMemoryBatchWriteTool`},{tool:`memory_dump_region`,method:`handleMemoryDumpRegionTool`},{tool:`memory_list_regions`,method:`handleMemoryListRegionsTool`},{tool:`memory_audit_export`,method:`handleMemoryAuditExportTool`},{tool:`inject_dll`,method:`handleInjectDllTool`},{tool:`inject_shellcode`,method:`handleInjectShellcodeTool`},{tool:`check_debug_port`,method:`handleCheckDebugPortTool`},{tool:`enumerate_modules`,method:`handleEnumerateModulesTool`},{tool:`process_enum_threads`,method:`handleProcessEnumThreadsTool`},{tool:`process_detect_hollowing`,method:`handleDetectHollowingTool`},{tool:`process_hollowing_scan`,method:`handleHollowingScanTool`},{tool:`process_enum_handles`,method:`handleProcessEnumHandlesTool`},{tool:`process_detect_apc`,method:`handleProcessDetectApcTool`},{tool:`process_suspend`,method:`handleProcessSuspendTool`},{tool:`process_resume`,method:`handleProcessResumeTool`}]}),d={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`full`],ensure:s,registrations:c?u:u.filter(e=>!l.has(e.tool.name))};export{d as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ensure-browser-core-BP70x0TB.mjs";import{t}from"./registry-DJDnkQW2.mjs";import{n}from"./bind-helpers-D0mGAOof.mjs";import{t as r}from"./definitions-Cexmkypg.mjs";import{t as i}from"./definitions-9csunmeX.mjs";const a=`workflow`,o=`workflowHandlers`,s=t([...r,...i]),c=n({domain:a,depKey:o,lookup:s,entries:[{tool:`page_script_register`,method:`handlePageScriptRegisterTool`},{tool:`page_script_run`,method:`handlePageScriptRunTool`},{tool:`api_probe_batch`,method:`handleApiProbeBatchTool`},{tool:`js_bundle_search`,method:`handleJsBundleSearchTool`},{tool:`list_extension_workflows`,method:`handleListExtensionWorkflowsTool`},{tool:`run_extension_workflow`,method:`handleRunExtensionWorkflowTool`},{tool:`reverse_session`,method:`handleReverseSessionTool`,profiles:[`full`]},{tool:`workflow_run_inspect`,method:`handleWorkflowRunInspectTool`},{tool:`workflow_conditional_step`,method:`handleWorkflowConditionalStepTool`},{tool:`workflow_retry_policy`,method:`handleWorkflowRetryPolicyTool`}]}),l=n({domain:a,depKey:`macroHandlers`,lookup:s,entries:[{tool:`run_macro`,method:`handleRunMacroTool`,profiles:[`full`]},{tool:`list_macros`,method:`handleListMacrosTool`,profiles:[`full`]}]});async function u(t){let{WorkflowHandlers:n}=await import(`./workflow-DHktRNF2.mjs`),{MacroToolHandlers:r}=await import(`./macro-nUYUjKNZ.mjs`);await e(t);let i=t.handlerDeps.browserHandlers,a=t.handlerDeps.advancedHandlers;return t.workflowHandlers||=new n({browserHandlers:i,advancedHandlers:a,serverContext:t}),t.macroHandlers||=new r(t),t.workflowHandlers}const d={kind:`domain-manifest`,version:1,domain:a,depKey:o,secondaryDepKeys:[`macroHandlers`],profiles:[`workflow`,`full`],ensure:u,workflowRule:{patterns:[/(workflow|extension|run|macro)/i,/(工作流|扩展|运行|宏)/i,/(reverse|re).*(session|workflow|pipeline|full.?chain|托管|全链路)/i,/(android|apk|dex|frida|adb).*(dump|intake|artifact|session)/i],priority:95,tools:[`run_extension_workflow`,`list_extension_workflows`,`run_macro`,`list_macros`,`reverse_session`],hint:`Workflow & macros: list workflows → run workflow; list macros → run macro; reverse_session creates recoverable full-chain reverse evidence workflows.`},prerequisites:{page_script_run:[{condition:`Browser must be launched`,fix:`Call browser_launch or browser_attach first`}],api_probe_batch:[{condition:`Browser must be launched`,fix:`Call browser_launch or browser_attach first`},{condition:`Network monitoring must be enabled`,fix:`Call network_monitor(enable) first`}],js_bundle_search:[{condition:`Browser must be launched`,fix:`Call browser_launch or browser_attach first`}],run_extension_workflow:[{condition:`Browser must be launched`,fix:`Call browser_launch or browser_attach first`}]},registrations:[...c,...l]};export{d as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./registry-DJDnkQW2.mjs";import{n as t}from"./bind-helpers-D0mGAOof.mjs";const n=[{name:`exploit_find_gadgets`,description:`Search for ROP/JOP/COP/COOP gadgets in a binary file. Returns addresses, instructions, and bytes for each gadget. Supports filtering by regex pattern and gadget type. User must provide target binary.`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file (ELF, PE, Mach-O)`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`],description:`Target architecture`},type:{type:`string`,enum:[`rop`,`jop`,`cop`,`coop`],description:`Gadget type: rop (return-oriented), jop (jump-oriented), cop (call-oriented), coop (counterfeit object-oriented). Default: rop.`,default:`rop`},maxGadgets:{type:`number`,description:`Maximum number of gadgets to return (default: 1000)`,default:1e3},pattern:{type:`string`,description:`Regex pattern to filter gadgets (e.g., "pop .* ; ret")`},maxDepth:{type:`number`,description:`Maximum gadget instruction depth (default: 5)`,default:5}},required:[`binaryPath`,`arch`]}},{name:`exploit_build_rop_chain`,description:`Construct a ROP chain for a specified goal (execve, write_memory, call_function). Automatically searches for required gadgets and chains them. Returns hex chain and gadget list. User must provide command/address/function as needed.`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`]},goal:{type:`string`,enum:[`execve`,`write_memory`,`call_function`],description:`Exploit goal type`},command:{type:`string`,description:`Command to execute (for execve goal)`},address:{type:`string`,description:`Target memory address (hex, for write_memory goal)`},value:{type:`string`,description:`Value to write (hex, for write_memory goal)`},functionAddress:{type:`string`,description:`Function address to call (hex, for call_function goal)`},args:{type:`array`,items:{type:`string`},description:`Function arguments (hex strings, for call_function goal)`}},required:[`binaryPath`,`arch`,`goal`]}},{name:`exploit_encode_shellcode`,description:`Encode shellcode to avoid bad characters or detection. Supports alphanumeric, unicode, XOR, and fnstenv encodings. Returns encoded shellcode and decoder stub. User must provide raw shellcode.`,inputSchema:{type:`object`,properties:{shellcode:{type:`string`,description:`Raw shellcode as hex string (user-provided)`},encoding:{type:`string`,enum:[`alphanumeric`,`unicode`,`xor`,`fnstenv`,`shikata_ga_nai`],description:`Encoding scheme`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`]},badChars:{type:`array`,items:{type:`number`},description:`Bad characters to avoid (0x00-0xFF)`},xorKey:{type:`number`,description:`XOR key (0x00-0xFF, for xor encoding)`}},required:[`shellcode`,`encoding`,`arch`]}},{name:`exploit_analyze_mitigations`,description:`Detect binary security mitigations (NX/DEP, PIE/ASLR, stack canary, RELRO, FORTIFY_SOURCE, CFG). Returns boolean flags for each protection. CFG (Control Flow Guard) is detected on Windows PE via IMAGE_DLLCHARACTERISTICS_GUARD_CF (0x4000).`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file`}},required:[`binaryPath`]}},{name:`exploit_calculate_offsets`,description:`Calculate buffer overflow offset from crash value and De Bruijn pattern. Used to determine exact EIP/RIP overwrite offset.`,inputSchema:{type:`object`,properties:{pattern:{type:`string`,description:`De Bruijn pattern used in crash`},crashValue:{type:`string`,description:`Crash value (hex, e.g., "0x41613141")`}},required:[`pattern`,`crashValue`]}},{name:`exploit_generate_pattern`,description:`Generate De Bruijn sequence for offset finding. Every 4-byte substring is unique, allowing precise offset calculation from crash dumps.`,inputSchema:{type:`object`,properties:{length:{type:`number`,description:`Pattern length in bytes`},charset:{type:`string`,description:`Character set for pattern (default: A-Za-z0-9)`}},required:[`length`]}},{name:`exploit_find_jmp_esp`,description:`Find "jmp esp" / "call esp" style gadgets for stack pivoting. Searches for jump/call instructions targeting a specific register.`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`]},register:{type:`string`,description:`Target register (e.g., "esp", "rsp", "sp")`}},required:[`binaryPath`,`arch`,`register`]}},{name:`exploit_build_heap_spray`,description:`Generate heap spray payload for predictable heap layout. Supports V8 (ArrayBuffer), IE (BSTR), and generic (ArrayBuffer) spray targets. Returns spray code, allocation count, and predictability score.`,inputSchema:{type:`object`,properties:{target:{type:`string`,enum:[`v8`,`ie`,`generic`],description:`Spray target engine`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`],description:`Target architecture`},totalSize:{type:`number`,description:`Total spray size in bytes (default: 1MB)`},blockSize:{type:`number`,description:`Individual block size (default: 1MB)`},nopByte:{type:`number`,description:`NOP sled byte (default: 0x90 x86, auto ARM)`},shellcode:{type:`string`,description:`Encoded shellcode hex string to embed after NOP sled`}},required:[`target`,`arch`]}},{name:`exploit_build_format_string`,description:`Generate format string exploit payload for arbitrary write. Uses %hn (2-byte) writes for reliability. Returns hex payload and reliability assessment.`,inputSchema:{type:`object`,properties:{vulnOffset:{type:`number`,description:`Format argument position we control (e.g., 7 for %7$n)`},targetAddress:{type:`string`,description:`Address to write to (hex string)`},targetValue:{type:`string`,description:`Value to write (hex string)`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`],description:`Target architecture`},directAccess:{type:`boolean`,description:`Support direct parameter access (%n$) (default: true)`}},required:[`vulnOffset`,`targetAddress`,`targetValue`,`arch`]}},{name:`exploit_cache_stats`,description:`Get exploit-dev cache statistics including hit rate, memory usage, and entry count. Used for performance monitoring and cache tuning.`,inputSchema:{type:`object`,properties:{},required:[]}},{name:`exploit_cache_clear`,description:`Clear all cached exploit-dev results. Use when binaries have been modified or to free memory.`,inputSchema:{type:`object`,properties:{},required:[]}},{name:`exploit_cache_configure`,description:`Update exploit-dev cache configuration (TTLs, memory limits, enable/disable). Changes take effect immediately.`,inputSchema:{type:`object`,properties:{enabled:{type:`boolean`,description:`Enable/disable caching`},maxEntries:{type:`number`,description:`Maximum number of cache entries`},maxMemoryBytes:{type:`number`,description:`Maximum cache memory in bytes`},ttlGadgets:{type:`number`,description:`TTL for gadget results in milliseconds`},ttlMitigations:{type:`number`,description:`TTL for mitigation results in milliseconds`},ttlRopChain:{type:`number`,description:`TTL for ROP chain results in milliseconds`},ttlShellcode:{type:`number`,description:`TTL for shellcode encoding results in milliseconds`}},required:[]}},{name:`exploit_solve_constraints`,description:`Solve a system of constraints using the Z3 SMT solver. Each constraint is a JavaScript-like boolean expression (e.g. "x > 10", "y <= 20", "x + y < 100"). Constraints are conjunctive (AND-ed together). Supports int, real, bool, and bitvec variable types. Returns sat/unsat/unknown plus an optional model with variable assignments when SAT. Use this for ROP gadget verification, opaque predicate inversion, and general constraint solving.`,inputSchema:{type:`object`,properties:{constraints:{type:`array`,description:`Array of JavaScript-style boolean expression strings. Supported operators: < > <= >= == === != !== + - * / % && || !.Example: ["x > 10", "x < 20", "x !== 15"]`,items:{type:`string`}},variables:{type:`array`,description:`Variable declarations. Each entry has {name, type, bits?}. type: "int" (default), "bitvec" (needs bits), "real", "bool".Example: [{"name":"x","type":"int"}, {"name":"y","type":"bitvec","bits":64}]`,items:{type:`object`,properties:{name:{type:`string`,description:`Variable name used in constraints`},type:{type:`string`,enum:[`int`,`bitvec`,`real`,`bool`],description:`SMT sort`},bits:{type:`number`,description:`Bit width for bitvec type (default 64)`}},required:[`name`,`type`]}},timeout:{type:`number`,description:`Solver timeout in milliseconds (default 10000)`},getModel:{type:`boolean`,description:`Return variable assignments when SAT (default true)`}},required:[`constraints`,`variables`]}},{name:`exploit_verify_rop_chain`,description:`Verify a user-supplied ROP chain against an exploit goal using Z3. Decodes the hex chain into gadget addresses, matches each to a known gadget, simulates the register effects, and checks whether the final state satisfies the goal (e.g. execve syscall registers, write_memory address/value, call_function ABI args). Use this to audit hand-crafted or third-party ROP chains before use. Returns valid flag, decoded chain, final register state, violations, and warnings.`,inputSchema:{type:`object`,properties:{chain:{type:`string`,description:`Hex string of pointer-sized little-endian addresses (as produced by exploit_build_rop_chain). Example: "000000000000007e3b..."`},gadgets:{type:`array`,description:`Candidate gadget pool to match chain addresses against (as returned by exploit_find_gadgets). Omit if using binaryPath to auto-discover.`,items:{type:`object`,properties:{address:{type:`string`,description:`Hex address (e.g. "0x7e")`},instructions:{type:`array`,items:{type:`string`}},bytes:{type:`string`},effects:{type:`object`,properties:{pops:{type:`array`,items:{type:`string`}},writes:{type:`array`,items:{type:`object`}},calls:{type:`array`,items:{type:`string`}},returns:{type:`boolean`}}}}}},binaryPath:{type:`string`,description:`Optional binary path to discover gadgets when gadgets is omitted`},goal:{type:`string`,enum:[`execve`,`write_memory`,`call_function`],description:`Exploit goal to verify against`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`],description:`Target architecture (determines pointer size and ABI)`},command:{type:`string`,description:`Command string (for execve goal)`},address:{type:`string`,description:`Target address hex (for write_memory goal)`},value:{type:`string`,description:`Value to write hex (for write_memory goal)`},functionAddress:{type:`string`,description:`Function address hex (for call_function goal)`},args:{type:`array`,items:{type:`string`},description:`Function arguments hex (for call_function goal)`}},required:[`chain`,`goal`,`arch`]}},{name:`exploit_generate_egghunter`,description:`Generate egghunter shellcode for constrained buffer sizes. An egghunter searches process memory for a 4-byte "egg" tag (repeated twice) and jumps to the real shellcode following it. Supports Linux x86 access(2)-based and Windows SEH-based egghunters. Reference: skape, "Safely Searching Process Virtual Address Space" (2004).`,inputSchema:{type:`object`,properties:{type:{type:`string`,enum:[`access`,`seh`],description:`Egghunter type: access = Linux access(2)-based (~35 bytes x86), seh = Windows SEH-based`},eggTag:{type:`string`,description:`4-byte egg tag as hex string (e.g., "0x50905090"). Must appear twice consecutively before real shellcode. Default: random nop-safe tag.`},arch:{type:`string`,enum:[`x86`,`x64`],description:`Target architecture. access egghunter is x86-only.`}},required:[`type`,`arch`]}},{name:`exploit_build_stack_pivot`,description:`Find and assemble stack pivot gadgets from a binary. Stack pivots redirect the stack pointer (ESP/RSP) to a controlled buffer, enabling ROP chains when limited stack space is available. Detects xchg(add/sub/mov,sp), push/pop(sp), leave, and add sp,N pivot patterns.`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`],description:`Target architecture`},reg:{type:`string`,description:`Target register for xchg-type pivots (e.g., "eax", "rax"). Filters results.`},redirectTo:{type:`string`,description:`Address to redirect execution to after pivot (hex string). Used to chain stage-2 ROP.`}},required:[`binaryPath`,`arch`]}},{name:`exploit_cache_invalidate`,description:`Invalidate cached exploit-dev results for a specific binary (by path). Computes the binary hash and removes all matching cache entries. Call without binaryPath to clear the entire cache. Use when binaries have been recompiled or modified.`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file to invalidate cache for (optional — clears all if omitted)`}},required:[]}},{name:`exploit_build_jop_chain`,description:`Build a JOP (Jump-Oriented Programming) chain from binary gadgets. JOP bypasses CFI by chaining gadgets via an indirect-jump dispatcher (e.g. jmp [rax]) instead of ret. Discovers dispatcher candidates, groups functional gadgets by dispatch register, and assembles a chain that covers the specified goal constraints. Also supports COP (Call-Oriented) and COOP (Counter-Object Oriented) chains.`,inputSchema:{type:`object`,properties:{binaryPath:{type:`string`,description:`Path to binary file (ELF, PE, Mach-O)`},arch:{type:`string`,enum:[`x86`,`x64`,`arm`,`arm64`],description:`Target architecture`},type:{type:`string`,enum:[`jop`,`cop`,`coop`],description:`Chain type: jop (jump-oriented), cop (call-oriented), coop (vtable hijack). Default: jop.`,default:`jop`},goal:{type:`string`,enum:[`execve`,`write_memory`,`call_function`],description:`Exploit goal. Default: execve.`,default:`execve`},maxGadgets:{type:`number`,description:`Maximum gadgets to search (default: 200)`,default:200}},required:[`binaryPath`,`arch`]}},{name:`exploit_discover_one_gadget`,description:`Discover one-gadget (single-address shell-spawning) offsets for common libc versions. First checks a built-in database (glibc 2.23/2.27/2.31/2.35/2.39 for x64/x86, musl 1.2), then falls back to heuristic binary scanning for custom libcs. Returns offsets with constraints (e.g. "[rsp+0x70] == NULL") that must be satisfied for the one-gadget to work. Also lists all known libc identities when called with listKnown=true.`,inputSchema:{type:`object`,properties:{libcPath:{type:`string`,description:`Path to libc binary (for heuristic scanning, optional)`},libcId:{type:`string`,description:`libc identity string (e.g. "glibc-2.31-x64"). Use listKnown=true to see available IDs.`},listKnown:{type:`boolean`,description:`List all known libc identities in the database (set true to list)`,default:!1}},required:[]}},{name:`exploit_build_ret2dlresolve`,description:`Build a ret2dlresolve payload that forges ELF dynamic-linker structures to resolve an arbitrary symbol (e.g. "system") without knowing libc addresses. Generates fake .rel.plt, .dynsym, and .dynstr entries. Supports x86 (Elf32_Rel) and x64 (Elf64_Rela). Returns hex payload, reloc_offset, and structural details. Pure-TS offline builder — no live process needed. Reference: phrack #58 article 4, pwntools Ret2dlresolvePayload.`,inputSchema:{type:`object`,properties:{arch:{type:`string`,enum:[`x86`,`x64`],description:`Target architecture`},elfHex:{type:`string`,description:`Raw ELF file bytes as hex string for section address extraction`},fakeStructsAddr:{type:`string`,description:`Writable memory address where the fake structures will be placed (hex string, e.g. "0xdead0000")`},targetFunction:{type:`string`,description:`Function name to resolve (e.g. "system", "execve")`},elfLoadBase:{type:`string`,description:`For PIE binaries: base address where ELF is loaded (hex string). Default: 0.`},knownGotAddr:{type:`string`,description:`Known GOT entry address to overwrite (optional; defaults to fakeStructsAddr + struct size)`}},required:[`arch`,`elfHex`,`fakeStructsAddr`,`targetFunction`]}},{name:`exploit_generate_pwntools`,description:`Generate a pwntools-compatible Python exploit script (exploit.py). Accepts ROP chain data, JOP chain data, shellcode payload, or one-gadget offset and emits a ready-to-run script with proper ELF loading, remote/local I/O setup, and payload assembly. Templates: io, rop, shellcode, ret2libc, format.`,inputSchema:{type:`object`,properties:{template:{type:`string`,enum:[`io`,`rop`,`shellcode`,`ret2libc`,`format`],description:`Script template: io (basic I/O), rop (ROP chain), shellcode (shellcode injection), ret2libc (one-gadget with libc leak), format (fmtstr).`},binary:{type:`string`,description:`Path to target binary (used for ELF loading and ./process)`},arch:{type:`string`,enum:[`amd64`,`i386`,`aarch64`,`arm`],description:`pwntools context.arch value. Default: amd64.`,default:`amd64`},remote:{type:`string`,description:`Remote target as host:port (e.g. "example.com:1337"). Omit for local process.`},ropChain:{type:`string`,description:`ROP chain hex string (from exploit_build_rop_chain) — used with template=rop`},shellcode:{type:`string`,description:`Shellcode hex bytes (from exploit_encode_shellcode) — used with template=shellcode`},oneGadgetOffset:{type:`string`,description:`One-gadget offset hex (from exploit_discover_one_gadget) — used with template=ret2libc`},libcPath:{type:`string`,description:`Path to libc for leak context (used with template=ret2libc)`},libcBase:{type:`string`,description:`Known libc base address hex (used with template=ret2libc)`},formatOffset:{type:`number`,description:`Format string offset (used with template=format)`},formatWrites:{type:`array`,description:`Format string writes: [{ addr: "0x...", value: "0x...", size: 4 }] (used with template=format)`}},required:[`template`]}}],r=`exploit-dev`,i=`exploitDevHandlers`,a=t({domain:r,depKey:i,lookup:e(n),entries:[{tool:`exploit_find_gadgets`,method:`handleFindGadgets`},{tool:`exploit_build_rop_chain`,method:`handleBuildRopChain`},{tool:`exploit_encode_shellcode`,method:`handleEncodeShellcode`},{tool:`exploit_analyze_mitigations`,method:`handleAnalyzeMitigations`},{tool:`exploit_calculate_offsets`,method:`handleCalculateOffsets`},{tool:`exploit_generate_pattern`,method:`handleGeneratePattern`},{tool:`exploit_find_jmp_esp`,method:`handleFindJmpEsp`},{tool:`exploit_cache_stats`,method:`handleGetCacheStats`},{tool:`exploit_cache_clear`,method:`handleClearCache`},{tool:`exploit_cache_configure`,method:`handleConfigureCache`},{tool:`exploit_build_heap_spray`,method:`handleBuildHeapSpray`},{tool:`exploit_build_format_string`,method:`handleBuildFormatString`},{tool:`exploit_solve_constraints`,method:`handleSolveConstraints`},{tool:`exploit_verify_rop_chain`,method:`handleVerifyRopChain`},{tool:`exploit_generate_egghunter`,method:`handleGenerateEgghunter`},{tool:`exploit_build_stack_pivot`,method:`handleBuildStackPivot`},{tool:`exploit_cache_invalidate`,method:`handleCacheInvalidate`},{tool:`exploit_build_jop_chain`,method:`handleBuildJopChain`},{tool:`exploit_discover_one_gadget`,method:`handleDiscoverOneGadget`},{tool:`exploit_generate_pwntools`,method:`handleGeneratePwntools`},{tool:`exploit_build_ret2dlresolve`,method:`handleBuildRet2dlresolve`}]});async function o(e){let{ExploitDevHandlers:t}=await import(`./handlers-DRKMaA-_.mjs`),n=e.getDomainInstance(i);return n||(n=new t(e),e.setDomainInstance(i,n)),n}const s={kind:`domain-manifest`,version:1,domain:r,depKey:i,profiles:[`full`],ensure:o,registrations:a,workflowRule:{patterns:[/\b(rop|jop|gadget|shellcode|exploit|buffer\s?overflow|stack\s?pivot)\b/i,/(mitigation|nx|dep|pie|aslr|canary|relro)/i,/(pattern|offset|crash|eip|rip|overflow)/i,/(encode|alphanumeric|unicode|xor|bad\s?char)/i],priority:85,tools:[`exploit_analyze_mitigations`,`exploit_find_gadgets`,`exploit_generate_pattern`,`exploit_calculate_offsets`],hint:`Exploit development pipeline: analyze_mitigations → find_gadgets → build_rop_chain OR generate_pattern → calculate_offsets. Use encode_shellcode to avoid bad characters.`},prerequisites:{exploit_find_gadgets:[{condition:`Binary file must exist and be readable`,fix:`Provide valid path to ELF, PE, or Mach-O binary`}],exploit_build_rop_chain:[{condition:`Binary must contain sufficient gadgets for goal`,fix:`Try different binary or use manual gadget chaining`}],exploit_encode_shellcode:[{condition:`User must provide raw shellcode (hex string)`,fix:`Generate or obtain shellcode externally (not provided by jshookmcp)`}]}};export{s as default};