@jshookmcp/jshook 0.2.8 → 0.2.9

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 (157) hide show
  1. package/README.md +36 -5
  2. package/README.zh.md +36 -5
  3. package/dist/{AntiCheatDetector-S8VRj-dD.mjs → AntiCheatDetector-BNk-EoBt.mjs} +3 -3
  4. package/dist/{CodeInjector-4Z3ngPoX.mjs → CodeInjector-Cq8q01kp.mjs} +5 -5
  5. package/dist/ConsoleMonitor-CPVQW1Y-.mjs +2201 -0
  6. package/dist/{DarwinAPI-B8hg_yhz.mjs → DarwinAPI-BNPxu0RH.mjs} +1 -1
  7. package/dist/DetailedDataManager-BQQcxh64.mjs +217 -0
  8. package/dist/EventBus-DgPmwpeu.mjs +141 -0
  9. package/dist/EvidenceGraphBridge-SFesNera.mjs +153 -0
  10. package/dist/{ExtensionManager-D5-bO9D8.mjs → ExtensionManager-CWYgw0YW.mjs} +13 -6
  11. package/dist/{FingerprintManager-BVxFJL2-.mjs → FingerprintManager-gzWtkKuf.mjs} +1 -1
  12. package/dist/{HardwareBreakpoint-DK1yjWkV.mjs → HardwareBreakpoint-B9gZCdFP.mjs} +3 -3
  13. package/dist/{HeapAnalyzer-CEbo10xU.mjs → HeapAnalyzer-BLDH0dCv.mjs} +4 -4
  14. package/dist/HookGeneratorBuilders.core.generators.storage-CtcdK78Q.mjs +639 -0
  15. package/dist/InstrumentationSession-CvPC7Jwy.mjs +244 -0
  16. package/dist/{MemoryController-DdtnBdD4.mjs → MemoryController-CbVdCIJF.mjs} +3 -3
  17. package/dist/{MemoryScanSession-RMixN3bX.mjs → MemoryScanSession-BsDZbLYm.mjs} +81 -78
  18. package/dist/{MemoryScanner-QjK4ld0B.mjs → MemoryScanner-Bcpml6II.mjs} +44 -18
  19. package/dist/{NativeMemoryManager.impl-CB6gJ0NM.mjs → NativeMemoryManager.impl-dZtA1ZGn.mjs} +14 -53
  20. package/dist/{NativeMemoryManager.utils-BML4q1ry.mjs → NativeMemoryManager.utils-B-FjA2mJ.mjs} +1 -1
  21. package/dist/{PEAnalyzer-CK0xe0Fs.mjs → PEAnalyzer-D1lzJ_VG.mjs} +2 -2
  22. package/dist/PageController-Bqm2kZ_X.mjs +417 -0
  23. package/dist/{PointerChainEngine-Cd73qu5b.mjs → PointerChainEngine-BOhyVsjx.mjs} +4 -4
  24. package/dist/PrerequisiteError-Dl33Svkz.mjs +20 -0
  25. package/dist/ResponseBuilder-D3iFYx2N.mjs +143 -0
  26. package/dist/ReverseEvidenceGraph-Dlsk94LC.mjs +269 -0
  27. package/dist/ScriptManager-aHHq0X7U.mjs +3000 -0
  28. package/dist/{Speedhack-CeF0XmEz.mjs → Speedhack-CqdIFlQl.mjs} +2 -2
  29. package/dist/{StructureAnalyzer-D4GkMduU.mjs → StructureAnalyzer-DhFaPvRO.mjs} +3 -3
  30. package/dist/ToolCatalog-C0JGZoOm.mjs +582 -0
  31. package/dist/ToolError-jh9whhMd.mjs +15 -0
  32. package/dist/ToolProbe-oC7aPrkv.mjs +45 -0
  33. package/dist/ToolRegistry-BjaF4oNz.mjs +131 -0
  34. package/dist/ToolRouter.policy-BWV67ZK-.mjs +304 -0
  35. package/dist/TraceRecorder-DgxyVbdQ.mjs +519 -0
  36. package/dist/{Win32API-Bc0QnQsN.mjs → Win32API-CePkipZY.mjs} +1 -1
  37. package/dist/{Win32Debug-DUHt9XUn.mjs → Win32Debug-BvKs-gxc.mjs} +2 -2
  38. package/dist/WorkflowEngine-CuvkZtWu.mjs +598 -0
  39. package/dist/analysis-CL9uACt9.mjs +463 -0
  40. package/dist/antidebug-CqDTB_uk.mjs +1081 -0
  41. package/dist/artifactRetention-CFEprwPw.mjs +591 -0
  42. package/dist/artifacts-Bk2-_uPq.mjs +59 -0
  43. package/dist/betterSqlite3-0pqusHHH.mjs +74 -0
  44. package/dist/binary-instrument-CXfpx6fT.mjs +979 -0
  45. package/dist/bind-helpers-xFfRF-qm.mjs +22 -0
  46. package/dist/boringssl-inspector-BH2D3VKc.mjs +180 -0
  47. package/dist/browser-BpOr5PEx.mjs +4082 -0
  48. package/dist/concurrency-Bt0yv1kJ.mjs +41 -0
  49. package/dist/{constants-CCvsN80K.mjs → constants-B0OANIBL.mjs} +88 -46
  50. package/dist/coordination-qUbyF8KU.mjs +259 -0
  51. package/dist/debugger-gnKxRSN0.mjs +1271 -0
  52. package/dist/definitions-6M-eejaT.mjs +53 -0
  53. package/dist/definitions-B18eyf0B.mjs +18 -0
  54. package/dist/definitions-B3QdlrHv.mjs +34 -0
  55. package/dist/definitions-B4rAvHNZ.mjs +63 -0
  56. package/dist/definitions-BB_4jnmy.mjs +37 -0
  57. package/dist/definitions-BMfYXoNC.mjs +43 -0
  58. package/dist/definitions-Beid2EB3.mjs +27 -0
  59. package/dist/definitions-C1UvM5Iy.mjs +126 -0
  60. package/dist/definitions-CXEI7QC72.mjs +216 -0
  61. package/dist/definitions-C_4r7Fo-2.mjs +14 -0
  62. package/dist/definitions-CkFDALoa.mjs +26 -0
  63. package/dist/definitions-Cke7zEb8.mjs +94 -0
  64. package/dist/definitions-ClJLzsJQ.mjs +25 -0
  65. package/dist/definitions-Cq-zroAU.mjs +28 -0
  66. package/dist/definitions-Cy3Sl6gV.mjs +34 -0
  67. package/dist/definitions-D3VsGcvz.mjs +47 -0
  68. package/dist/definitions-DVGfrn7y.mjs +96 -0
  69. package/dist/definitions-LKpC3-nL.mjs +9 -0
  70. package/dist/definitions-bAhHQJq9.mjs +359 -0
  71. package/dist/encoding-Bvz5jLRv.mjs +1065 -0
  72. package/dist/evidence-graph-bridge-C_fv9PuC.mjs +135 -0
  73. package/dist/{factory-CibqTNC8.mjs → factory-DxlGh9Xf.mjs} +37 -52
  74. package/dist/graphql-DYWzJ29s.mjs +1026 -0
  75. package/dist/handlers-9sAbfIg-.mjs +2552 -0
  76. package/dist/handlers-Bl8zkwz1.mjs +2716 -0
  77. package/dist/handlers-C67ktuRN.mjs +710 -0
  78. package/dist/handlers-C87g8oCe.mjs +276 -0
  79. package/dist/handlers-CTsDAO6p.mjs +681 -0
  80. package/dist/handlers-Cgyg6c0U.mjs +645 -0
  81. package/dist/handlers-D6j6yka7.mjs +2124 -0
  82. package/dist/handlers-DdFzXLvF.mjs +446 -0
  83. package/dist/handlers-DeLOCd5m.mjs +799 -0
  84. package/dist/handlers-DlCJN4Td.mjs +757 -0
  85. package/dist/handlers-DxGIq15_2.mjs +917 -0
  86. package/dist/handlers-U6L4xhuF.mjs +585 -0
  87. package/dist/handlers-tB9Mp9ZK.mjs +84 -0
  88. package/dist/handlers-tiy7EIBp.mjs +572 -0
  89. package/dist/handlers.impl-DS0d9fUw.mjs +761 -0
  90. package/dist/hooks-CzCWByww.mjs +898 -0
  91. package/dist/index.mjs +377 -155
  92. package/dist/{logger-BmWzC2lM.mjs → logger-Dh_xb7_2.mjs} +14 -6
  93. package/dist/maintenance-P7ePRXQC.mjs +830 -0
  94. package/dist/manifest-2ToTpjv8.mjs +106 -0
  95. package/dist/manifest-3g71z6Bg.mjs +79 -0
  96. package/dist/manifest-82baTv4U.mjs +45 -0
  97. package/dist/manifest-B3QVVeBS.mjs +82 -0
  98. package/dist/manifest-BB2J8IMJ.mjs +149 -0
  99. package/dist/manifest-BKbgbSiY.mjs +60 -0
  100. package/dist/manifest-Bcf-TJzH.mjs +848 -0
  101. package/dist/manifest-BmtZzQiQ2.mjs +45 -0
  102. package/dist/manifest-Bnd7kqEY.mjs +55 -0
  103. package/dist/manifest-BqQX6OQC2.mjs +65 -0
  104. package/dist/manifest-BqrQ4Tpj.mjs +81 -0
  105. package/dist/manifest-Br4RPFt5.mjs +370 -0
  106. package/dist/manifest-C5qDjysN.mjs +107 -0
  107. package/dist/manifest-C9RT5nk32.mjs +34 -0
  108. package/dist/manifest-CAhOuvSl.mjs +204 -0
  109. package/dist/manifest-CBYWCUBJ.mjs +51 -0
  110. package/dist/manifest-CFADCRa1.mjs +37 -0
  111. package/dist/manifest-CQVhavRF.mjs +114 -0
  112. package/dist/manifest-CT7zZBV1.mjs +48 -0
  113. package/dist/manifest-CV12bcrF.mjs +121 -0
  114. package/dist/manifest-CXsRWjjI.mjs +224 -0
  115. package/dist/manifest-CZLUCfG02.mjs +95 -0
  116. package/dist/manifest-D6phHKFd.mjs +131 -0
  117. package/dist/manifest-DCyjf4n2.mjs +294 -0
  118. package/dist/manifest-DHsnKgP6.mjs +60 -0
  119. package/dist/manifest-Df_dliIe.mjs +55 -0
  120. package/dist/manifest-Dh8WBmEW.mjs +129 -0
  121. package/dist/manifest-DhKRAT8_.mjs +92 -0
  122. package/dist/manifest-DlpTj4ic2.mjs +193 -0
  123. package/dist/manifest-DrbmZcFl2.mjs +253 -0
  124. package/dist/manifest-DuwHjUa5.mjs +70 -0
  125. package/dist/manifest-DzwvxPJX.mjs +38 -0
  126. package/dist/manifest-NXctwWQq.mjs +68 -0
  127. package/dist/manifest-Sc_0JQ13.mjs +418 -0
  128. package/dist/manifest-gZ4s_UtG.mjs +96 -0
  129. package/dist/manifest-qSleDqdO.mjs +1023 -0
  130. package/dist/modules-C184v-S9.mjs +11365 -0
  131. package/dist/mojo-ipc-B_H61Afw.mjs +525 -0
  132. package/dist/network-671Cw6hV.mjs +3346 -0
  133. package/dist/{artifacts-BbdOMET5.mjs → outputPaths-B1uGmrWZ.mjs} +219 -212
  134. package/dist/parse-args-BlRjqlkL.mjs +39 -0
  135. package/dist/platform-WmNn8Sxb.mjs +2070 -0
  136. package/dist/process-QcbIy5Zq.mjs +1401 -0
  137. package/dist/proxy-DqNs0bAd.mjs +170 -0
  138. package/dist/registry-D-6e18lB.mjs +34 -0
  139. package/dist/response-BQVP-xUn.mjs +28 -0
  140. package/dist/server/plugin-api.mjs +2 -2
  141. package/dist/shared-state-board-DV-dpHFJ.mjs +586 -0
  142. package/dist/sourcemap-Dq8ez8vS.mjs +650 -0
  143. package/dist/ssrf-policy-ZaUfvhq7.mjs +166 -0
  144. package/dist/streaming-BUQ0VJsg.mjs +725 -0
  145. package/dist/tool-builder-DCbIC5Eo.mjs +186 -0
  146. package/dist/transform-CiYJfNX0.mjs +1007 -0
  147. package/dist/types-Bx92KJfT.mjs +4 -0
  148. package/dist/wasm-DQTnHDs4.mjs +531 -0
  149. package/dist/workflow-f3xJOcjx.mjs +725 -0
  150. package/package.json +16 -16
  151. package/dist/ExtensionManager-CPTJhHFg.mjs +0 -2
  152. package/dist/ToolCatalog-Bq4V2sbJ.mjs +0 -67201
  153. package/dist/{CacheAdapters-CzFNpD9a.mjs → CacheAdapters-CDe5WPSV.mjs} +0 -0
  154. package/dist/{StealthVerifier-BzBCFiwx.mjs → StealthVerifier-Bo4T3bz8.mjs} +0 -0
  155. package/dist/{VersionDetector-CNXcvD46.mjs → VersionDetector-CwVLVdDM.mjs} +0 -0
  156. package/dist/{formatAddress-ChCSIRWT.mjs → formatAddress-DVkj9kpI.mjs} +0 -0
  157. package/dist/{types-BBjOqye-.mjs → types-CPhOReNX.mjs} +1 -1
@@ -0,0 +1,53 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/platform/definitions.ts
3
+ const platformTools = [
4
+ tool("miniapp_pkg_scan", (t) => t.desc("扫描本地小程序缓存目录,列出所有 小程序包文件。默认扫描常见 Windows 路径。").string("searchPath", "可选。指定扫描根目录;不提供时使用默认路径(MiniApp/Cache 与 MiniApp/Plugin)。")),
5
+ tool("miniapp_pkg_unpack", (t) => t.desc("解包 小程序包文件。优先调用外部 外部解包工具,失败时自动降级为纯 Node.js 解析。").string("inputPath", "必填。小程序包文件路径。").string("outputDir", "可选。输出目录;不提供时自动生成 artifacts 临时目录。").required("inputPath")),
6
+ tool("miniapp_pkg_analyze", (t) => t.desc("分析解包后的小程序结构,提取 pages/subPackages/components/jsFiles/totalSize/appId。").string("unpackedDir", "必填。已解包目录路径。").required("unpackedDir")),
7
+ tool("asar_extract", (t) => t.desc("提取 Electron app.asar(纯 Node.js 实现,不依赖 @electron/asar)。支持仅列文件模式。").string("inputPath", "必填。asar 文件路径。").string("outputDir", "可选。提取目录;不提供时自动生成 artifacts 临时目录。").boolean("listOnly", "可选。默认 false;true 时仅列出文件清单,不执行提取。", { default: false }).required("inputPath")),
8
+ tool("electron_inspect_app", (t) => t.desc("分析 Electron 应用结构(.exe 或 app 目录):package.json、main、preload、dependencies、devToo...").string("appPath", "Path to Electron app (.exe or app directory)").required("appPath")),
9
+ tool("electron_scan_userdata", (t) => t.desc("扫描指定目录中的所有 JSON 文件,返回 raw 内容。适用于 Electron 应用的用户数据目录(Windows: %APPDATA%, macOS...").string("dirPath", "Directory path to scan for JSON files").number("maxFiles", "可选。最多读取的 JSON 文件数量。默认 20。", {
10
+ default: 20,
11
+ minimum: 1,
12
+ maximum: 1e4
13
+ }).number("maxFileSizeKB", "可选。单个文件大小上限(KB)。超限文件跳过。默认 1024。", {
14
+ default: 1024,
15
+ minimum: 1,
16
+ maximum: 102400
17
+ }).required("dirPath").query()),
18
+ tool("asar_search", (t) => t.desc("在 ASAR 归档内执行正则搜索。Agent 提供 pattern,工具返回匹配文件路径和行内容。").string("inputPath", "必填。ASAR 文件路径。").string("pattern", "必填。正则表达式字符串。").string("fileGlob", "可选。文件扩展名过滤。默认 *.js。", { default: "*.js" }).number("maxResults", "可选。最大返回匹配数。默认 100。", {
19
+ default: 100,
20
+ minimum: 1,
21
+ maximum: 1e4
22
+ }).required("inputPath", "pattern").query()),
23
+ tool("electron_check_fuses", (t) => t.desc("检测 Electron 可执行文件中的 fuse 配置状态(ASAR 完整性校验、RunAsNode 等)。").string("exePath", "必填。Electron .exe 文件路径。").required("exePath").query()),
24
+ tool("electron_patch_fuses", (t) => t.desc("Patch Electron binary fuses to enable/disable debug capabilities.").string("exePath", "Electron .exe file path").enum("profile", ["debug", "custom"], "Patch profile. \"debug\" enables debug-related fuses. \"custom\" requires a fuses object.", { default: "debug" }).object("fuses", {}, "For profile=\"custom\". Map of fuse names to ENABLE/DISABLE. E.g. {\"RunAsNode\": \"ENABLE\"}.").boolean("createBackup", "Create a .exe.bak backup before patching.", { default: true }).required("exePath").destructive()),
25
+ tool("v8_bytecode_decompile", (t) => t.desc("Decompile V8 bytecode (.jsc / bytenode) files. Uses view8 Python package for ...").string("filePath", "Path to .jsc bytecode file").required("filePath").query()),
26
+ tool("electron_launch_debug", (t) => t.desc("Launch Electron app with dual CDP debugging: --inspect for main process (Node...").string("exePath", "Electron .exe file path").number("mainPort", "Main process inspect port.", {
27
+ default: 9229,
28
+ minimum: 1,
29
+ maximum: 65535
30
+ }).number("rendererPort", "Renderer remote debugging port.", {
31
+ default: 9222,
32
+ minimum: 1,
33
+ maximum: 65535
34
+ }).array("args", { type: "string" }, "Extra command-line arguments.").boolean("skipFuseCheck", "Skip fuse status check.", { default: false }).number("waitMs", "Milliseconds to wait for CDP ports.", {
35
+ default: 8e3,
36
+ minimum: 1e3,
37
+ maximum: 12e4
38
+ }).requiredOpenWorld("exePath")),
39
+ tool("electron_debug_status", (t) => t.desc("Check status of dual-CDP debug sessions launched by electron_launch_debug.").string("sessionId", "Optional. Check specific session. Omit to list all.").query()),
40
+ tool("electron_ipc_sniff", (t) => t.desc("Sniff Electron IPC messages by injecting hooks into ipcRenderer via CDP.").enum("action", [
41
+ "start",
42
+ "dump",
43
+ "stop",
44
+ "list",
45
+ "guide"
46
+ ], "Action to perform.", { default: "guide" }).number("port", "Renderer CDP port (--remote-debugging-port).", {
47
+ default: 9222,
48
+ minimum: 1,
49
+ maximum: 65535
50
+ }).string("sessionId", "Session ID for dump/stop.").boolean("clear", "Clear captured messages after dump.", { default: true }).openWorld())
51
+ ];
52
+ //#endregion
53
+ export { platformTools as t };
@@ -0,0 +1,18 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/antidebug/definitions.ts
3
+ const antidebugTools = [tool("antidebug_bypass", (t) => t.desc("Bypass one or more anti-debug protection types. Specify types to apply; omit or use [\"all\"] to apply all bypasses. Types: all, debugger_statement, timing, stack_trace, console_detect.").array("types", {
4
+ type: "string",
5
+ enum: [
6
+ "all",
7
+ "debugger_statement",
8
+ "timing",
9
+ "stack_trace",
10
+ "console_detect"
11
+ ]
12
+ }, "Bypass types to apply (default: [\"all\"])").boolean("persistent", "Inject persistently for future documents", { default: true }).enum("mode", ["remove", "noop"], "Debugger statement mode (for debugger_statement type)", { default: "remove" }).number("maxDrift", "Max timing drift per call in ms (for timing type)", {
13
+ default: 50,
14
+ minimum: 0,
15
+ maximum: 1e4
16
+ }).array("filterPatterns", { type: "string" }, "Additional stack frame patterns to filter (for stack_trace type)")), tool("antidebug_detect_protections", (t) => t.desc("Detect anti-debug protections in current page with bypass recommendations"))];
17
+ //#endregion
18
+ export { antidebugTools as t };
@@ -0,0 +1,34 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/shared-state-board/definitions.ts
3
+ const sharedStateBoardTools = [
4
+ tool("state_board", (t) => t.desc(`Unified shared state board for cross-agent key-value coordination.
5
+
6
+ Actions:
7
+ - set: Store a value (requires key, value)
8
+ - get: Retrieve a value (requires key)
9
+ - delete: Remove a value (requires key)
10
+ - list: List all entries (optional namespace filter)
11
+ - history: Get change log for a key (requires key)
12
+ - clear: Remove entries (optional namespace/keyPattern filter)`).enum("action", [
13
+ "set",
14
+ "get",
15
+ "delete",
16
+ "list",
17
+ "history",
18
+ "clear"
19
+ ], "Operation to perform").string("key", "Key name (required for set/get/delete/history)").prop("value", {
20
+ type: "object",
21
+ description: "Value to store — any JSON-serializable type (action=set)"
22
+ }).string("namespace", "Namespace for key isolation (default: \"default\")").number("ttlSeconds", "TTL in seconds — value expires after this duration (action=set)").boolean("includeValues", "Include current values in list response (action=list)", { default: false }).number("limit", "Maximum history entries to return (action=history)", { default: 50 }).string("keyPattern", "Key pattern filter with * wildcard (action=clear)").required("action")),
23
+ tool("state_board_watch", (t) => t.desc("Watch a key or pattern for changes. This is a POLL-based watch — call state_board_watch with action=poll and the returned watchId to check for changes. No server-side push; the caller must poll periodically.").enum("action", [
24
+ "start",
25
+ "poll",
26
+ "stop"
27
+ ], "Watch operation: start watching, poll for changes, or stop watching").string("key", "The key or pattern to watch (action=start)").string("namespace", "Optional namespace (default: \"default\")").number("pollIntervalMs", "Polling interval in ms (action=start, default: 1000)").string("watchId", "Watch ID to stop (action=stop)").required("action")),
28
+ tool("state_board_io", (t) => t.desc("Export or import state board entries.").enum("action", ["export", "import"], "IO operation").string("namespace", "Optional namespace filter for export / target namespace for import (default: all/\"default\")").string("keyPattern", "Optional key pattern filter for export (supports * wildcard)").prop("data", {
29
+ type: "object",
30
+ description: "Object with keys and values to import (action=import)"
31
+ }).boolean("overwrite", "Overwrite existing keys on import (default: false)").required("action"))
32
+ ];
33
+ //#endregion
34
+ export { sharedStateBoardTools as t };
@@ -0,0 +1,63 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/process/definitions.ts
3
+ /**
4
+ * Process Manager Tool Definitions
5
+ * MCP tools for cross-platform process management and debugging
6
+ */
7
+ const processToolDefinitions = [
8
+ tool("process_windows", (t) => t.desc("Get all window handles for a process.").number("pid", "Process ID to get windows for").required("pid")),
9
+ tool("process_check_debug_port", (t) => t.desc("Check if a process has a debug port enabled for CDP attachment.").number("pid", "Process ID to check").required("pid")),
10
+ tool("process_launch_debug", (t) => t.desc("Launch an executable with remote debugging port enabled.").string("executablePath", "Full path to the executable to launch").number("debugPort", "Debug port to use", {
11
+ default: 9222,
12
+ minimum: 1,
13
+ maximum: 65535
14
+ }).array("args", { type: "string" }, "Additional command line arguments").required("executablePath")),
15
+ tool("memory_read", (t) => t.desc("Read memory from a process at a specific address. Requires elevated privileges.").string("address", "Memory address to read (hex string like \"0x12345678\")").number("size", "Number of bytes to read").required("pid", "address", "size")),
16
+ tool("memory_write", (t) => t.desc("Write data to process memory at a specific address. Requires elevated privileges.").string("address", "Memory address to write to (hex string like \"0x12345678\")").string("data", "Data to write (hex string or base64)").enum("encoding", ["hex", "base64"], "Encoding of the data parameter", { default: "hex" }).required("pid", "address", "data")),
17
+ tool("memory_scan", (t) => t.desc("Scan process memory for a pattern or value. Requires elevated privileges.").string("pattern", "Pattern to search for (hex bytes like \"48 8B 05\" or value)").enum("patternType", [
18
+ "hex",
19
+ "int32",
20
+ "int64",
21
+ "float",
22
+ "double",
23
+ "string"
24
+ ], "Type of pattern to search", { default: "hex" }).boolean("suspendTarget", "Suspend the target process during scan for a consistent memory snapshot (default: false)", { default: false }).required("pid", "pattern")),
25
+ tool("memory_check_protection", (t) => t.desc("Check memory protection flags at a specific address.").string("address", "Memory address to check (hex string like \"0x12345678\")").required("pid", "address")),
26
+ tool("memory_scan_filtered", (t) => t.desc("Scan memory within a filtered set of addresses (secondary scan).").string("pattern", "Pattern to search for").array("addresses", { type: "string" }, "List of addresses to scan within (from previous scan)").enum("patternType", [
27
+ "hex",
28
+ "int32",
29
+ "int64",
30
+ "float",
31
+ "double",
32
+ "string"
33
+ ], "Type of pattern to search", { default: "hex" }).required("pid", "pattern", "addresses")),
34
+ tool("memory_batch_write", (t) => t.desc("Write multiple memory patches at once.").number("pid", "Target process ID").array("patches", {
35
+ type: "object",
36
+ properties: {
37
+ address: {
38
+ type: "string",
39
+ description: "Memory address (hex)"
40
+ },
41
+ data: {
42
+ type: "string",
43
+ description: "Data to write"
44
+ },
45
+ encoding: {
46
+ type: "string",
47
+ enum: ["hex", "base64"],
48
+ default: "hex"
49
+ }
50
+ },
51
+ required: ["address", "data"]
52
+ }, "Array of patches to apply").required("pid", "patches")),
53
+ tool("memory_dump_region", (t) => t.desc("Dump a memory region to a file for analysis.").number("pid", "Target process ID").string("address", "Start address (hex)").number("size", "Number of bytes to dump").string("outputPath", "Output file path").required("pid", "address", "size", "outputPath")),
54
+ tool("memory_list_regions", (t) => t.desc("List all memory regions in a process with protection flags.").number("pid", "Target process ID").required("pid")),
55
+ tool("memory_audit_export", (t) => t.desc("Export the in-memory audit trail for memory operations as JSON.")),
56
+ tool("inject_dll", (t) => t.desc("Inject a DLL into a target process using CreateRemoteThread + LoadLibraryA (W...").string("dllPath", "Full path to the DLL file to inject").required("pid", "dllPath")),
57
+ tool("inject_shellcode", (t) => t.desc("Inject and execute shellcode in a target process.").string("shellcode", "Shellcode bytes (hex string or base64)").enum("encoding", ["hex", "base64"], "Encoding of shellcode", { default: "hex" }).required("pid", "shellcode")),
58
+ tool("check_debug_port", (t) => t.desc("Check if a process is being debugged using NtQueryInformationProcess (ProcessDebugPort).").number("pid", "Target process ID").required("pid")),
59
+ tool("enumerate_modules", (t) => t.desc("List all loaded modules (DLLs) in a process with their base addresses.").number("pid", "Target process ID").required("pid")),
60
+ tool("electron_attach", (t) => t.desc("Connect to a running Electron app (VS Code, Cursor, etc.) via CDP and inspect...").string("pageUrl", "Filter pages by URL substring (e.g. \"extension-host\" to target VS Code extension host)"))
61
+ ];
62
+ //#endregion
63
+ export { processToolDefinitions as t };
@@ -0,0 +1,37 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/streaming/definitions.ts
3
+ const streamingTools = [
4
+ tool("ws_monitor", (t) => t.desc("Enable or disable WebSocket frame capture via CDP Network events.").enum("action", ["enable", "disable"], "Monitor action").string("urlFilter", "Regex filter for WebSocket URL (action=enable)").number("maxFrames", "Maximum frames in memory (action=enable, default: 1000)", {
5
+ default: 1e3,
6
+ minimum: 1,
7
+ maximum: 1e5
8
+ }).required("action").destructive()),
9
+ tool("ws_get_frames", (t) => t.desc("Get captured WebSocket frames with pagination and payload filter").enum("direction", [
10
+ "sent",
11
+ "received",
12
+ "all"
13
+ ], "Frame direction filter", { default: "all" }).number("limit", "Maximum frames to return", {
14
+ default: 100,
15
+ minimum: 1,
16
+ maximum: 1e4
17
+ }).number("offset", "Pagination offset", {
18
+ default: 0,
19
+ minimum: 0
20
+ }).string("payloadFilter", "Regex filter on frame payload").readOnly()),
21
+ tool("ws_get_connections", (t) => t.desc("Get tracked WebSocket connections and frame counts").readOnly()),
22
+ tool("sse_monitor_enable", (t) => t.desc("Enable SSE monitoring by injecting EventSource interceptor").string("urlFilter", "Regex filter for EventSource URL").number("maxEvents", "Maximum SSE events in memory", {
23
+ default: 2e3,
24
+ minimum: 1,
25
+ maximum: 1e5
26
+ }).boolean("persistent", "Survive page navigations via evaluateOnNewDocument")),
27
+ tool("sse_get_events", (t) => t.desc("Get captured SSE events with filters and pagination").string("sourceUrl", "Filter by EventSource URL").string("eventType", "Filter by SSE event type").number("limit", "Maximum events", {
28
+ default: 100,
29
+ minimum: 1,
30
+ maximum: 1e4
31
+ }).number("offset", "Pagination offset", {
32
+ default: 0,
33
+ minimum: 0
34
+ }).readOnly())
35
+ ];
36
+ //#endregion
37
+ export { streamingTools as t };
@@ -0,0 +1,43 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/hooks/definitions.ts
3
+ const aiHookTools = [tool("ai_hook", (t) => t.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", [
4
+ "inject",
5
+ "get_data",
6
+ "list",
7
+ "clear",
8
+ "toggle",
9
+ "export"
10
+ ], "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"))];
11
+ const hookPresetTools = [tool("hook_preset", (t) => t.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", {
12
+ type: "object",
13
+ properties: {
14
+ id: {
15
+ type: "string",
16
+ description: "Stable preset id, for example deobfuscation-sinks"
17
+ },
18
+ description: {
19
+ type: "string",
20
+ description: "Human-readable description for listPresets output."
21
+ },
22
+ body: {
23
+ type: "string",
24
+ description: "Hook body snippet inserted into the preset wrapper."
25
+ }
26
+ },
27
+ required: ["id", "body"],
28
+ 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."
29
+ }).prop("customTemplates", {
30
+ type: "array",
31
+ items: {
32
+ type: "object",
33
+ properties: {
34
+ id: { type: "string" },
35
+ description: { type: "string" },
36
+ body: { type: "string" }
37
+ },
38
+ required: ["id", "body"]
39
+ },
40
+ description: "List of inline custom templates to register for this invocation."
41
+ }).boolean("captureStack", "Include call stack in captured data (has performance impact)", { default: false }).boolean("logToConsole", "Log hook events to browser console", { default: true }).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: false }))];
42
+ //#endregion
43
+ export { hookPresetTools as n, aiHookTools as t };
@@ -0,0 +1,27 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/graphql/definitions.ts
3
+ const graphqlTools = [
4
+ tool("call_graph_analyze", (t) => t.desc("Analyze runtime function call graph from in-page traces").number("maxDepth", "Maximum stack-derived edge depth", { default: 5 }).string("filterPattern", "Regex filter for function names").query()),
5
+ tool("script_replace_persist", (t) => t.desc("Persistently replace matching script responses via request interception").string("url", "Script URL match pattern").string("replacement", "Replacement JavaScript source").enum("matchType", [
6
+ "exact",
7
+ "contains",
8
+ "regex"
9
+ ], "URL matching strategy", { default: "contains" }).requiredOpenWorld("url", "replacement")),
10
+ tool("graphql_introspect", (t) => t.desc("Run GraphQL introspection query against a target endpoint").string("endpoint", "GraphQL endpoint URL").prop("headers", {
11
+ type: "object",
12
+ description: "Custom request headers",
13
+ additionalProperties: { type: "string" }
14
+ }).boolean("useBrowser", "Use the active browser session for fetch so cookies and CSRF/app-injected headers are preserved. Set false to force a Node-side fetch.", { default: true }).requiredOpenWorld("endpoint")),
15
+ tool("graphql_extract_queries", (t) => t.desc("Extract GraphQL queries/mutations from captured network traces").number("limit", "Maximum extracted operations", { default: 50 }).query()),
16
+ tool("graphql_replay", (t) => t.desc("Replay a GraphQL operation with optional variables via in-page fetch").string("endpoint", "GraphQL endpoint URL").string("query", "GraphQL query/mutation string").prop("variables", {
17
+ type: "object",
18
+ description: "GraphQL variables",
19
+ additionalProperties: true
20
+ }).string("operationName", "GraphQL operationName").prop("headers", {
21
+ type: "object",
22
+ description: "Custom request headers",
23
+ additionalProperties: { type: "string" }
24
+ }).boolean("useBrowser", "Use the active browser session for fetch so cookies and CSRF/app-injected headers are preserved. Set false to force a Node-side fetch.", { default: true }).requiredOpenWorld("endpoint", "query"))
25
+ ];
26
+ //#endregion
27
+ export { graphqlTools as t };
@@ -0,0 +1,126 @@
1
+ import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
2
+ //#region src/server/domains/analysis/definitions.ts
3
+ const webcrackMappingsSchema = {
4
+ type: "array",
5
+ description: "Remapping rules for unpacked bundle module paths",
6
+ items: {
7
+ type: "object",
8
+ properties: {
9
+ path: {
10
+ type: "string",
11
+ description: "New module path when matched"
12
+ },
13
+ pattern: {
14
+ type: "string",
15
+ description: "Match text or regex"
16
+ },
17
+ matchType: {
18
+ type: "string",
19
+ enum: [
20
+ "includes",
21
+ "regex",
22
+ "exact"
23
+ ],
24
+ description: "How to interpret pattern",
25
+ default: "includes"
26
+ },
27
+ target: {
28
+ type: "string",
29
+ enum: ["code", "path"],
30
+ description: "Match against source code or module path",
31
+ default: "code"
32
+ }
33
+ },
34
+ required: ["path", "pattern"]
35
+ }
36
+ };
37
+ /** Shared webcrack options added to a builder */
38
+ function withWebcrackOpts(b) {
39
+ return b.boolean("unpack", "Unpack webpack/browserify bundles", { default: true }).boolean("unminify", "Reformat and unminify code", { default: true }).boolean("jsx", "Decompile React.createElement to JSX", { default: true }).boolean("mangle", "Rename obfuscated identifiers", { default: false }).string("outputDir", "Directory to save deobfuscated artifacts").boolean("forceOutput", "Remove outputDir before saving", { default: false }).boolean("includeModuleCode", "Include module source in bundle output", { default: false }).number("maxBundleModules", "Maximum bundle modules to return", {
40
+ default: 100,
41
+ minimum: 1,
42
+ maximum: 1e4
43
+ }).prop("mappings", webcrackMappingsSchema);
44
+ }
45
+ const coreTools = [
46
+ tool("collect_code", (t) => t.desc("Collect JavaScript from a target website in summary, priority, incremental, o...").boolean("includeInline", "Include inline scripts", { default: true }).boolean("includeExternal", "Include external scripts", { default: true }).boolean("includeDynamic", "Include dynamically loaded scripts", { default: false }).enum("smartMode", [
47
+ "summary",
48
+ "priority",
49
+ "incremental",
50
+ "full"
51
+ ], "Collection mode", { default: "full" }).boolean("compress", "Enable compression", { default: false }).number("maxTotalSize", "Maximum total size in bytes", {
52
+ default: 2097152,
53
+ minimum: 1024,
54
+ maximum: 10485760
55
+ }).number("maxFileSize", "Maximum single file size in KB", {
56
+ default: 500,
57
+ minimum: 1,
58
+ maximum: 102400
59
+ }).array("priorities", { type: "string" }, "Preferred URL patterns for priority mode").boolean("returnSummaryOnly", "Return summary only", { default: false }).string("url", "Target URL to collect scripts from").requiredOpenWorld("url")),
60
+ tool("search_in_scripts", (t) => t.desc("Search collected scripts by keyword or regex pattern").string("keyword", "Search keyword or regex pattern").boolean("isRegex", "Treat keyword as regex", { default: false }).boolean("caseSensitive", "Case-sensitive search", { default: false }).number("contextLines", "Context lines around each match", {
61
+ default: 3,
62
+ minimum: 0,
63
+ maximum: 50
64
+ }).number("maxMatches", "Maximum matches", {
65
+ default: 100,
66
+ minimum: 1,
67
+ maximum: 1e4
68
+ }).boolean("returnSummary", "Return summary instead of full payload", { default: false }).number("maxContextSize", "Max response size before summary fallback", {
69
+ default: 5e4,
70
+ minimum: 1e3,
71
+ maximum: 1e6
72
+ }).required("keyword").query()),
73
+ tool("extract_function_tree", (t) => t.desc("Extract a function and its dependency tree from collected scripts").string("scriptId", "Script identifier").string("functionName", "Function name to extract").number("maxDepth", "Maximum dependency traversal depth", {
74
+ default: 3,
75
+ minimum: 1,
76
+ maximum: 20
77
+ }).number("maxSize", "Maximum output size in KB", {
78
+ default: 500,
79
+ minimum: 1,
80
+ maximum: 10240
81
+ }).boolean("includeComments", "Include comments in extracted source", { default: true }).required("scriptId", "functionName")),
82
+ tool("deobfuscate", (t) => withWebcrackOpts(t.desc("Run webcrack-powered JavaScript deobfuscation with bundle unpacking. Use engine=\"webcrack\" for aggressive VM/advanced options.").string("code", "Obfuscated JavaScript source").enum("engine", ["auto", "webcrack"], "Deobfuscation engine", { default: "auto" }).enum("llm", ["gpt-4", "claude"], "Preferred LLM for analysis", { default: "gpt-4" }).boolean("aggressive", "Aggressive deobfuscation strategy", { default: false }).boolean("detectOnly", "Detect only without transformation (webcrack engine)", { default: false }).boolean("aggressiveVM", "Aggressive VM deobfuscation (webcrack engine)", { default: false }).boolean("useASTOptimization", "Apply AST optimization after transformation (webcrack engine)", { default: true }).number("timeout", "Operation timeout in ms (webcrack engine)", {
83
+ default: 6e4,
84
+ minimum: 1e3,
85
+ maximum: 12e4
86
+ })).required("code")),
87
+ tool("understand_code", (t) => t.desc("Run semantic code analysis for structure, behavior, and risks").string("code", "Source code to analyze").prop("context", {
88
+ type: "object",
89
+ description: "Additional contextual data"
90
+ }).enum("focus", [
91
+ "structure",
92
+ "business",
93
+ "security",
94
+ "all"
95
+ ], "Analysis focus", { default: "all" }).required("code")),
96
+ tool("detect_crypto", (t) => t.desc("Detect cryptographic algorithms and usage patterns in source code").string("code", "Source code for crypto analysis").required("code").query()),
97
+ tool("manage_hooks", (t) => t.desc("Create, inspect, and clear JavaScript runtime hooks").enum("action", [
98
+ "create",
99
+ "list",
100
+ "records",
101
+ "clear"
102
+ ], "Hook management operation").string("target", "Hook target identifier").enum("type", [
103
+ "function",
104
+ "xhr",
105
+ "fetch",
106
+ "websocket",
107
+ "localstorage",
108
+ "cookie"
109
+ ], "Hook target type").enum("hookAction", [
110
+ "log",
111
+ "block",
112
+ "modify"
113
+ ], "Hook behavior", { default: "log" }).string("customCode", "Custom JavaScript hook payload").string("hookId", "Hook identifier").requiredOpenWorld("action")),
114
+ tool("detect_obfuscation", (t) => t.desc("Detect obfuscation techniques in JavaScript source").string("code", "Source code to inspect").boolean("generateReport", "Include human-readable report", { default: true }).required("code").query()),
115
+ tool("webcrack_unpack", (t) => withWebcrackOpts(t.desc("Run webcrack bundle unpacking and return extracted module graph").string("code", "Bundled or obfuscated JavaScript source")).required("code")),
116
+ tool("clear_collected_data", (t) => t.desc("Clear collected script data, caches, and in-memory indexes").destructive()),
117
+ tool("get_collection_stats", (t) => t.desc("Get collection, cache, and compression statistics").query()),
118
+ tool("webpack_enumerate", (t) => t.desc("Enumerate webpack modules in current page and search for keywords").string("searchKeyword", "Keyword to search across module exports").boolean("forceRequireAll", "Force-require every module", { default: false }).number("maxResults", "Maximum matching modules", {
119
+ default: 20,
120
+ minimum: 1,
121
+ maximum: 1e4
122
+ }).openWorld()),
123
+ tool("llm_suggest_names", (t) => t.desc("Use client LLM (via MCP sampling) to suggest meaningful names for obfuscated ...").array("identifiers", { type: "string" }, "Array of obfuscated identifier names to rename").required("code", "identifiers").readOnly())
124
+ ];
125
+ //#endregion
126
+ export { coreTools as t };