@jshookmcp/jshook 0.2.8 → 0.3.0

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 (162) hide show
  1. package/README.md +36 -5
  2. package/README.zh.md +36 -5
  3. package/dist/{AntiCheatDetector-S8VRj-dD.mjs → AntiCheatDetector-CqGDXmfc.mjs} +160 -54
  4. package/dist/{CodeInjector-4Z3ngPoX.mjs → CodeInjector-BdjRfNx7.mjs} +5 -5
  5. package/dist/ConsoleMonitor-DykL3IAw.mjs +2269 -0
  6. package/dist/{DarwinAPI-B8hg_yhz.mjs → DarwinAPI-ETyy0xyo.mjs} +1 -1
  7. package/dist/DetailedDataManager-HT49OrvF.mjs +217 -0
  8. package/dist/EventBus-DFKvADm3.mjs +141 -0
  9. package/dist/EvidenceGraphBridge-318Oi0Lf.mjs +153 -0
  10. package/dist/{ExtensionManager-D5-bO9D8.mjs → ExtensionManager-BDMsY2Dz.mjs} +27 -13
  11. package/dist/{FingerprintManager-BVxFJL2-.mjs → FingerprintManager-BN4UQWnX.mjs} +1 -1
  12. package/dist/{HardwareBreakpoint-DK1yjWkV.mjs → HardwareBreakpoint-Cc2AFq1Y.mjs} +3 -3
  13. package/dist/{HeapAnalyzer-CEbo10xU.mjs → HeapAnalyzer-DruMgsgj.mjs} +21 -21
  14. package/dist/HookGeneratorBuilders.core.generators.storage-CTbB4Lcx.mjs +566 -0
  15. package/dist/InstrumentationSession-DLH0vd-z.mjs +244 -0
  16. package/dist/{MemoryController-DdtnBdD4.mjs → MemoryController-CMtviNW_.mjs} +3 -3
  17. package/dist/{MemoryScanSession-RMixN3bX.mjs → MemoryScanSession-ITgb_NMi.mjs} +81 -78
  18. package/dist/{MemoryScanner-QjK4ld0B.mjs → MemoryScanner-CiL7Z3ey.mjs} +50 -21
  19. package/dist/{NativeMemoryManager.impl-CB6gJ0NM.mjs → NativeMemoryManager.impl-D9Lkovvn.mjs} +20 -56
  20. package/dist/{NativeMemoryManager.utils-BML4q1ry.mjs → NativeMemoryManager.utils-BBlAixF5.mjs} +1 -1
  21. package/dist/{PEAnalyzer-CK0xe0Fs.mjs → PEAnalyzer-DMQ44gen.mjs} +16 -16
  22. package/dist/PageController-BPJNqqBN.mjs +431 -0
  23. package/dist/{PointerChainEngine-Cd73qu5b.mjs → PointerChainEngine-K7wN8Z-w.mjs} +10 -7
  24. package/dist/PrerequisiteError-TuyZIs6n.mjs +20 -0
  25. package/dist/ProcessRegistry-zGg12QbE.mjs +74 -0
  26. package/dist/ResponseBuilder-CJXWmWNw.mjs +143 -0
  27. package/dist/ReverseEvidenceGraph-C02-gXOh.mjs +269 -0
  28. package/dist/ScriptManager-ZuWD-0Jg.mjs +3003 -0
  29. package/dist/{Speedhack-CeF0XmEz.mjs → Speedhack-D-z0umeT.mjs} +2 -2
  30. package/dist/{StructureAnalyzer-D4GkMduU.mjs → StructureAnalyzer-Cav5AVSL.mjs} +9 -6
  31. package/dist/ToolCatalog-5OJdMiF0.mjs +582 -0
  32. package/dist/ToolError-jh9whhMd.mjs +15 -0
  33. package/dist/ToolProbe-DbCFGyrg.mjs +45 -0
  34. package/dist/ToolRegistry-B9krbTtI.mjs +180 -0
  35. package/dist/ToolRouter.policy-BGDAGyeH.mjs +344 -0
  36. package/dist/TraceRecorder-B41Z5XBj.mjs +1286 -0
  37. package/dist/{Win32API-Bc0QnQsN.mjs → Win32API-C2kjj0ze.mjs} +19 -13
  38. package/dist/{Win32Debug-DUHt9XUn.mjs → Win32Debug-CKrGOTpo.mjs} +3 -3
  39. package/dist/WorkflowEngine-DJ6M4opp.mjs +569 -0
  40. package/dist/analysis-BHeJW2Nb.mjs +1234 -0
  41. package/dist/antidebug-BRKeyt27.mjs +1081 -0
  42. package/dist/artifactRetention-CPXkUJXp.mjs +598 -0
  43. package/dist/artifacts-DkfosXH3.mjs +59 -0
  44. package/dist/authorization-schema-DRqyJMSk.mjs +31 -0
  45. package/dist/betterSqlite3-DLSBZodi.mjs +74 -0
  46. package/dist/binary-instrument--V3MAhJ4.mjs +971 -0
  47. package/dist/bind-helpers-ClV34xdn.mjs +42 -0
  48. package/dist/boringssl-inspector-Bo_LOLaS.mjs +180 -0
  49. package/dist/browser-Dx3_S2cG.mjs +4369 -0
  50. package/dist/capabilities-CcHlvWgK.mjs +33 -0
  51. package/dist/concurrency-Drev_Vz9.mjs +41 -0
  52. package/dist/{constants-CCvsN80K.mjs → constants-CDZLOoVv.mjs} +105 -48
  53. package/dist/coordination-DgItD9DL.mjs +259 -0
  54. package/dist/debugger-RS3RSAqs.mjs +1288 -0
  55. package/dist/definitions-BEoYofW5.mjs +47 -0
  56. package/dist/definitions-BRaefg3u.mjs +365 -0
  57. package/dist/definitions-BbkvZkiv.mjs +96 -0
  58. package/dist/definitions-BtWSHJ3o.mjs +17 -0
  59. package/dist/definitions-C1gCHO0i.mjs +43 -0
  60. package/dist/definitions-CDOg_b-l.mjs +138 -0
  61. package/dist/definitions-CVPD9hzZ.mjs +54 -0
  62. package/dist/definitions-Cea8Lgl7.mjs +94 -0
  63. package/dist/definitions-DAgIyjxM.mjs +10 -0
  64. package/dist/definitions-DJA27nsL.mjs +66 -0
  65. package/dist/definitions-DKPFU3LW.mjs +25 -0
  66. package/dist/definitions-DPRpZQ96.mjs +47 -0
  67. package/dist/definitions-DUE5gmdn.mjs +18 -0
  68. package/dist/definitions-DYVjOtxa.mjs +26 -0
  69. package/dist/definitions-DcYLVLCo.mjs +37 -0
  70. package/dist/definitions-Pp5LI2H4.mjs +27 -0
  71. package/dist/definitions-j9KdHVNR.mjs +14 -0
  72. package/dist/definitions-uzkjBwa7.mjs +258 -0
  73. package/dist/definitions-va-AnLuQ.mjs +28 -0
  74. package/dist/encoding-DJeqHmpd.mjs +1079 -0
  75. package/dist/evidence-graph-bridge-DcYizFk2.mjs +136 -0
  76. package/dist/{factory-CibqTNC8.mjs → factory-C90tBff6.mjs} +41 -56
  77. package/dist/flat-target-session-Dgax2Cy3.mjs +29 -0
  78. package/dist/graphql-CoHrhweh.mjs +1197 -0
  79. package/dist/handlers-4jmR0nMs.mjs +898 -0
  80. package/dist/handlers-BAHPxcch.mjs +789 -0
  81. package/dist/handlers-BOs9b907.mjs +2600 -0
  82. package/dist/handlers-BWXEy6ef.mjs +917 -0
  83. package/dist/handlers-Bndn6QvE.mjs +111 -0
  84. package/dist/handlers-BqC4bD4s.mjs +681 -0
  85. package/dist/handlers-BtYq60bM2.mjs +276 -0
  86. package/dist/handlers-BzgcB4iv.mjs +799 -0
  87. package/dist/handlers-CRyRWj2b.mjs +859 -0
  88. package/dist/handlers-CVv2H1uq.mjs +592 -0
  89. package/dist/handlers-Dl5a7JS4.mjs +572 -0
  90. package/dist/handlers-Dx2d7jt7.mjs +2537 -0
  91. package/dist/handlers-Dz9PYsCa.mjs +2805 -0
  92. package/dist/handlers-HujRKC3b.mjs +661 -0
  93. package/dist/handlers.impl-XWXkQfyi.mjs +807 -0
  94. package/dist/hooks-B1B8NRHL.mjs +898 -0
  95. package/dist/index.mjs +491 -259
  96. package/dist/{logger-BmWzC2lM.mjs → logger-Dh_xb7_2.mjs} +14 -6
  97. package/dist/maintenance-PRMkLVRW.mjs +835 -0
  98. package/dist/manifest-67Bok-Si.mjs +58 -0
  99. package/dist/manifest-6lNTMZAB2.mjs +87 -0
  100. package/dist/manifest-B2duEHiH.mjs +90 -0
  101. package/dist/manifest-B6EY9Vm8.mjs +57 -0
  102. package/dist/manifest-B6nKSbyY.mjs +95 -0
  103. package/dist/manifest-BL8AQNPF.mjs +106 -0
  104. package/dist/manifest-BSZvJJmV.mjs +47 -0
  105. package/dist/manifest-BU7qzUyX.mjs +418 -0
  106. package/dist/manifest-Bl62e8WK.mjs +49 -0
  107. package/dist/manifest-Bo5cXjdt.mjs +82 -0
  108. package/dist/manifest-BpS4gtUK.mjs +1347 -0
  109. package/dist/manifest-Bv65_e2W.mjs +101 -0
  110. package/dist/manifest-BytNIF4Z.mjs +117 -0
  111. package/dist/manifest-C-xtsjS3.mjs +81 -0
  112. package/dist/manifest-CDYl7OhA.mjs +66 -0
  113. package/dist/manifest-CRZ3xmkD.mjs +61 -0
  114. package/dist/manifest-CoW6u4Tp.mjs +132 -0
  115. package/dist/manifest-Cq5zN_8A.mjs +50 -0
  116. package/dist/manifest-D7YZM_2e.mjs +194 -0
  117. package/dist/manifest-DE_VrAeQ.mjs +314 -0
  118. package/dist/manifest-DGsXSCpT.mjs +39 -0
  119. package/dist/manifest-DJ2vfEuW.mjs +156 -0
  120. package/dist/manifest-DPXDYhEu.mjs +80 -0
  121. package/dist/manifest-Dd4fQb0a.mjs +322 -0
  122. package/dist/manifest-Deq6opGg.mjs +223 -0
  123. package/dist/manifest-DfJTafJK.mjs +37 -0
  124. package/dist/manifest-DgOdgN_j.mjs +50 -0
  125. package/dist/manifest-DlbMW4v4.mjs +47 -0
  126. package/dist/manifest-DmVfbH0w.mjs +374 -0
  127. package/dist/manifest-Dog6Ddjr.mjs +109 -0
  128. package/dist/manifest-DvgU5FWb.mjs +58 -0
  129. package/dist/manifest-HsfDBs7j.mjs +50 -0
  130. package/dist/manifest-I8oQHvCG.mjs +186 -0
  131. package/dist/manifest-NvH_a-av.mjs +786 -0
  132. package/dist/manifest-cEJU1v0Z.mjs +129 -0
  133. package/dist/manifest-wOl5XLB12.mjs +112 -0
  134. package/dist/modules-tZozf0LQ.mjs +10635 -0
  135. package/dist/mojo-ipc-DXNEXEqb.mjs +640 -0
  136. package/dist/network-CPVvwvFg.mjs +3852 -0
  137. package/dist/{artifacts-BbdOMET5.mjs → outputPaths-um7lCRY3.mjs} +219 -216
  138. package/dist/parse-args-B4cY5Vx5.mjs +39 -0
  139. package/dist/platform-CYeFoTWp.mjs +2161 -0
  140. package/dist/process-BTbgcVc6.mjs +1306 -0
  141. package/dist/proxy-r8YN6nP1.mjs +192 -0
  142. package/dist/registry-Bl8ZQW61.mjs +34 -0
  143. package/dist/response-CWhh2aLo.mjs +34 -0
  144. package/dist/server/plugin-api.mjs +2 -2
  145. package/dist/shared-state-board-BoZnSoj-.mjs +586 -0
  146. package/dist/sourcemap-BIDHUVXy.mjs +934 -0
  147. package/dist/ssrf-policy-Dsqd-DTX.mjs +166 -0
  148. package/dist/streaming-Dal6utPp.mjs +725 -0
  149. package/dist/tool-builder-BHJp32mV.mjs +186 -0
  150. package/dist/transform-DRVgGG90.mjs +1011 -0
  151. package/dist/types-Bx92KJfT.mjs +4 -0
  152. package/dist/wasm-BYx5UOeG.mjs +1044 -0
  153. package/dist/webcrack-Be0_FccV.mjs +747 -0
  154. package/dist/workflow-BpuKEtvn.mjs +725 -0
  155. package/package.json +82 -49
  156. package/dist/ExtensionManager-CPTJhHFg.mjs +0 -2
  157. package/dist/ToolCatalog-Bq4V2sbJ.mjs +0 -67201
  158. package/dist/{CacheAdapters-CzFNpD9a.mjs → CacheAdapters-jJFy20G-.mjs} +0 -0
  159. package/dist/{StealthVerifier-BzBCFiwx.mjs → StealthVerifier-BWmPgQsv.mjs} +0 -0
  160. package/dist/{VersionDetector-CNXcvD46.mjs → VersionDetector-K3V4vGsw.mjs} +0 -0
  161. package/dist/{formatAddress-ChCSIRWT.mjs → formatAddress-nnMvEohD.mjs} +0 -0
  162. package/dist/{types-BBjOqye-.mjs → types-DDBWs9UP.mjs} +1 -1
@@ -0,0 +1,138 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.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
+ tool("js_deobfuscate_jsvmp", (t) => t.desc("Deobfuscate JSVMP/VM-protected JavaScript: extract VM bytecode and restore original logic.").string("code", "Obfuscated JavaScript source containing VM/JSVMP patterns").boolean("aggressive", "Use aggressive deobfuscation strategy", { default: false }).boolean("extractInstructions", "Extract and list VM instructions", { default: true }).number("timeout", "Deobfuscation timeout in ms", {
125
+ default: 3e4,
126
+ minimum: 5e3,
127
+ maximum: 12e4
128
+ }).boolean("detectOnly", "Only detect JSVMP without deobfuscating", { default: false }).required("code")),
129
+ tool("js_deobfuscate_pipeline", (t) => t.desc("Three-stage deobfuscation pipeline: preprocess → deobfuscate → humanize.").string("code", "Obfuscated JavaScript source").boolean("useWebcrack", "Apply webcrack after preprocessor stage", { default: true }).boolean("aggressive", "Enable aggressive transforms in deobfuscator stage", { default: false }).boolean("humanize", "Run humanizer stage (variable renaming)", { default: true }).boolean("returnStageDetails", "Include per-stage results in output", { default: false }).required("code")),
130
+ tool("js_analyze_vm", (t) => t.desc("Analyze JSVMP/VM interpreter structure: dispatch type, handler table, opcode map.").string("code", "JavaScript source containing VM interpreter").boolean("extractBytecode", "Attempt to extract VM bytecode", { default: true }).boolean("mapOpcodes", "Map opcodes to inferred operations", { default: true }).required("code")),
131
+ tool("js_solve_constraints", (t) => t.desc("Solve opaque predicates and constant expressions in obfuscated code.").string("code", "JavaScript source with opaque predicates or constant conditions").boolean("replaceInPlace", "Replace solved conditions with their constant values", { default: true }).number("maxIterations", "Maximum solving iterations", {
132
+ default: 100,
133
+ minimum: 1,
134
+ maximum: 1e4
135
+ }).required("code"))
136
+ ];
137
+ //#endregion
138
+ export { coreTools as t };
@@ -0,0 +1,54 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/platform/definitions.ts
3
+ const platformTools = [
4
+ tool("platform_capabilities", (t) => t.desc("Report platform tool backend availability.").query()),
5
+ tool("miniapp_pkg_scan", (t) => t.desc("Scan local directories for miniapp package files.").string("searchPath", "可选。指定扫描根目录;不提供时使用默认路径(MiniApp/Cache 与 MiniApp/Plugin)。")),
6
+ tool("miniapp_pkg_unpack", (t) => t.desc("Unpack a miniapp package.").string("inputPath", "必填。小程序包文件路径。").string("outputDir", "可选。输出目录;不提供时自动生成 artifacts 临时目录。").required("inputPath")),
7
+ tool("miniapp_pkg_analyze", (t) => t.desc("Analyze an unpacked miniapp package.").string("unpackedDir", "必填。已解包目录路径。").required("unpackedDir")),
8
+ tool("asar_extract", (t) => t.desc("Extract files from an Electron ASAR archive.").string("inputPath", "必填。asar 文件路径。").string("outputDir", "可选。提取目录;不提供时自动生成 artifacts 临时目录。").boolean("listOnly", "可选。默认 false;true 时仅列出文件清单,不执行提取。", { default: false }).required("inputPath")),
9
+ tool("electron_inspect_app", (t) => t.desc("Inspect an Electron app structure.").string("appPath", "Path to Electron app (.exe or app directory)").required("appPath")),
10
+ tool("electron_scan_userdata", (t) => t.desc("Scan a directory for Electron JSON userdata files.").string("dirPath", "Directory path to scan for JSON files").number("maxFiles", "可选。最多读取的 JSON 文件数量。默认 20。", {
11
+ default: 20,
12
+ minimum: 1,
13
+ maximum: 1e4
14
+ }).number("maxFileSizeKB", "可选。单个文件大小上限(KB)。超限文件跳过。默认 1024。", {
15
+ default: 1024,
16
+ minimum: 1,
17
+ maximum: 102400
18
+ }).required("dirPath").query()),
19
+ tool("asar_search", (t) => t.desc("Search text inside an ASAR archive.").string("inputPath", "必填。ASAR 文件路径。").string("pattern", "必填。正则表达式字符串。").string("fileGlob", "可选。文件扩展名过滤。默认 *.js。", { default: "*.js" }).number("maxResults", "可选。最大返回匹配数。默认 100。", {
20
+ default: 100,
21
+ minimum: 1,
22
+ maximum: 1e4
23
+ }).required("inputPath", "pattern").query()),
24
+ tool("electron_check_fuses", (t) => t.desc("Read Electron fuse states.").string("exePath", "必填。Electron .exe 文件路径。").required("exePath").query()),
25
+ tool("electron_patch_fuses", (t) => t.desc("Patch Electron fuse states.").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()),
26
+ tool("v8_bytecode_decompile", (t) => t.desc("Decompile or extract strings from V8 bytecode files.").string("filePath", "Path to .jsc bytecode file").required("filePath").query()),
27
+ tool("electron_launch_debug", (t) => t.desc("Launch Electron with main and renderer CDP ports.").string("exePath", "Electron .exe file path").number("mainPort", "Main process inspect port.", {
28
+ default: 9229,
29
+ minimum: 1,
30
+ maximum: 65535
31
+ }).number("rendererPort", "Renderer remote debugging port.", {
32
+ default: 9222,
33
+ minimum: 1,
34
+ maximum: 65535
35
+ }).array("args", { type: "string" }, "Extra command-line arguments.").boolean("skipFuseCheck", "Skip fuse status check.", { default: false }).number("waitMs", "Milliseconds to wait for CDP ports.", {
36
+ default: 8e3,
37
+ minimum: 1e3,
38
+ maximum: 12e4
39
+ }).requiredOpenWorld("exePath")),
40
+ 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()),
41
+ tool("electron_ipc_sniff", (t) => t.desc("Monitor Electron IPC via renderer-side hooks.").enum("action", [
42
+ "start",
43
+ "dump",
44
+ "stop",
45
+ "list",
46
+ "guide"
47
+ ], "Action to perform.", { default: "guide" }).number("port", "Renderer CDP port (--remote-debugging-port).", {
48
+ default: 9222,
49
+ minimum: 1,
50
+ maximum: 65535
51
+ }).string("sessionId", "Session ID for dump/stop.").boolean("clear", "Clear captured messages after dump.", { default: true }).openWorld())
52
+ ];
53
+ //#endregion
54
+ export { platformTools as t };
@@ -0,0 +1,94 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/workflow/definitions.ts
3
+ const workflowNetworkPolicySchema = {
4
+ type: "object",
5
+ additionalProperties: false,
6
+ properties: {
7
+ allowPrivateNetwork: {
8
+ type: "boolean",
9
+ description: "Allow access to private/reserved targets only when the request also matches allowedHosts or allowedCidrs."
10
+ },
11
+ allowInsecureHttp: {
12
+ type: "boolean",
13
+ description: "Allow non-loopback HTTP targets only when the request also matches allowedHosts or allowedCidrs."
14
+ },
15
+ allowedHosts: {
16
+ type: "array",
17
+ items: { type: "string" },
18
+ description: "Exact hostname or host:port allowlist for the primary target (for example [\"labs.example.com\", \"localhost:8080\"])."
19
+ },
20
+ allowedCidrs: {
21
+ type: "array",
22
+ items: { type: "string" },
23
+ description: "CIDR allowlist applied after DNS resolution (for example [\"10.10.0.0/16\", \"192.168.1.10/32\"])."
24
+ },
25
+ allowedRedirectHosts: {
26
+ type: "array",
27
+ items: { type: "string" },
28
+ description: "Optional hostname or host:port allowlist for redirect hops. When omitted, redirects inherit allowedHosts/allowedCidrs."
29
+ }
30
+ },
31
+ description: "Request-level network authorization policy. Use this instead of process-wide bypasses when you need to reach a real lab target, private address, or plain HTTP service."
32
+ };
33
+ const workflowToolDefinitions = [
34
+ tool("js_bundle_search", (t) => t.desc("Fetch a remote JavaScript bundle and search it with multiple named regex patterns in a single call.\n\nFeatures over bundle_search script:\n- Server-side fetch (no browser CORS constraints)\n- Bundle caching (5-min TTL, keyed by URL) — avoids re-downloading 1MB+ files\n- SVG/base64 false-positive filtering (`stripNoise: true` by default)\n- Per-pattern independent context window (`contextBefore`/`contextAfter`)\n- Up to `maxMatches` hits per pattern\n\nExample:\n js_bundle_search({\n url: \"https://assets.example.com/main.js\",\n patterns: [\n { name: \"tier_values\", regex: \"subscription.plus|user_tier\" },\n { name: \"payment_apis\", regex: \"/api/v1/payment/[a-z_]+\" },\n { name: \"setSubscription\", regex: \"setSubscriptionPlus\\\\([^)]{0,80}\\\\)\" }\n ]\n })").string("url", "Remote URL of the JavaScript bundle to analyze").array("patterns", {
35
+ type: "object",
36
+ properties: {
37
+ name: {
38
+ type: "string",
39
+ description: "Human-readable label for this pattern"
40
+ },
41
+ regex: {
42
+ type: "string",
43
+ description: "JavaScript regex string"
44
+ },
45
+ contextBefore: {
46
+ type: "number",
47
+ description: "Characters of context before match (default: 80)"
48
+ },
49
+ contextAfter: {
50
+ type: "number",
51
+ description: "Characters of context after match (default: 80)"
52
+ }
53
+ },
54
+ required: ["name", "regex"]
55
+ }, "Named regex patterns to search for").boolean("cacheBundle", "Cache the bundle for 5 minutes to avoid re-downloads", { default: true }).boolean("stripNoise", "Skip matches inside SVG path data or base64 blobs", { default: true }).number("maxMatches", "Maximum matches to return per pattern", {
56
+ default: 10,
57
+ minimum: 1,
58
+ maximum: 1e3
59
+ }).prop("networkPolicy", workflowNetworkPolicySchema).requiredOpenWorld("url", "patterns")),
60
+ tool("page_script_register", (t) => t.desc("Register a named reusable JavaScript snippet in the Script Library.\n\nCore ships built-in snippets such as `auth_extract`, `bundle_search`, `react_fill_form`, and `dom_find_upgrade_buttons`.\n\nRegistered scripts are executed with `page_script_run`. Scripts may reference `__params__` (set at call time via page_script_run params).").string("name", "Unique script name (e.g. \"my_extractor\")").string("code", "JavaScript expression/IIFE to register. Use `typeof __params__ !== \"undefined\" ? __params__ : {}` to safely access runtime parameters.").string("description", "Optional human-readable description of the script").required("name", "code")),
61
+ tool("page_script_run", (t) => t.desc("Execute a named script from the Script Library in the current page context.\n\nOptionally inject runtime parameters accessible as `__params__` inside the script.\n\nExample:\n page_script_run({ name: \"bundle_search\", params: { url: \"https://cdn.main.js\", patterns: [\"tier\", \"subscription\"] } })\n page_script_run({ name: \"auth_extract\" })").string("name", "Script name to run (built-in or registered)").prop("params", {
62
+ type: "object",
63
+ additionalProperties: true,
64
+ description: "Optional parameters injected as __params__ (must be JSON-serializable)"
65
+ }).requiredOpenWorld("name")),
66
+ tool("api_probe_batch", (t) => t.desc("Probe multiple API endpoints in a single browser-context fetch burst.\n\nAuto-injects Bearer token from localStorage[token] / localStorage[active_token]. Returns status codes, content types, and response snippets for matching statuses. Skips HTML responses (login-redirect false-positives).\n\nReplaces 5–30 individual page_evaluate fetch calls with one tool call.\n\n**ALWAYS start with OpenAPI/Swagger discovery paths first** — a single 200 response gives you the full API schema:\n \"/docs\", \"/openapi.json\", \"/api/docs\", \"/swagger.json\", \"/api/v1/openapi.json\", \"/api/openapi.json\"\n\nExample:\n api_probe_batch({ baseUrl: \"https://chat.qwen.ai\", paths: [\"/docs\", \"/openapi.json\", \"/api/v1/users/me\", \"/api/v1/chats/\", \"/api/admin/users\"] })").string("baseUrl", "Base URL prefix (e.g. \"https://chat.qwen.ai\") — trailing slash will be stripped").array("paths", { type: "string" }, "Paths to probe (e.g. [\"/api/v1/users\", \"/api/v1/chats\"])").enum("method", [
67
+ "GET",
68
+ "POST",
69
+ "PUT",
70
+ "DELETE",
71
+ "PATCH",
72
+ "HEAD",
73
+ "OPTIONS"
74
+ ], "HTTP method for all probes", { default: "GET" }).object("headers", { additionalProperties: { type: "string" } }, "Additional HTTP headers to include in all requests").string("bodyTemplate", "JSON body string to send for POST/PUT/PATCH requests (optional)").array("includeBodyStatuses", { type: "number" }, "Status codes for which to include response body snippet (default: [200, 201, 204])").number("maxBodySnippetLength", "Max characters per response body snippet", {
75
+ default: 500,
76
+ minimum: 0,
77
+ maximum: 1e4
78
+ }).boolean("autoInjectAuth", "Auto-inject Bearer token from localStorage (token / active_token / access_token).", { default: true }).prop("networkPolicy", workflowNetworkPolicySchema).requiredOpenWorld("baseUrl", "paths")),
79
+ tool("list_extension_workflows", (t) => t.desc("List runtime-loaded extension workflows discovered from plugins/ or workflows/ directories, including metadata needed before execution.").query()),
80
+ tool("run_extension_workflow", (t) => t.desc("Execute a runtime-loaded extension workflow contract by workflowId. Supports config overrides, per-node input overrides, and an optional timeout override.").string("workflowId", "Registered extension workflow id to execute").string("profile", "Optional profile label exposed to the workflow execution context").prop("config", {
81
+ type: "object",
82
+ additionalProperties: true,
83
+ description: "Optional config overrides read through ctx.getConfig(path, fallback)"
84
+ }).prop("nodeInputOverrides", {
85
+ type: "object",
86
+ additionalProperties: {
87
+ type: "object",
88
+ additionalProperties: true
89
+ },
90
+ description: "Optional shallow input overrides keyed by workflow node id"
91
+ }).number("timeoutMs", "Optional override for total workflow timeout in milliseconds").requiredOpenWorld("workflowId"))
92
+ ];
93
+ //#endregion
94
+ export { workflowToolDefinitions as t };
@@ -0,0 +1,10 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/sourcemap/definitions.ts
3
+ const sourcemapTools = [
4
+ tool("sourcemap_discover", (t) => t.desc("Discover source maps on the current page.").boolean("includeInline", "Include inline data: source maps.", { default: true })),
5
+ tool("sourcemap_fetch_and_parse", (t) => t.desc("Parse a source map.").string("sourceMapUrl", "Source map URL.").string("scriptUrl", "Script URL for relative map resolution.").required("sourceMapUrl")),
6
+ tool("sourcemap_reconstruct_tree", (t) => t.desc("Reconstruct source files from a source map.").string("sourceMapUrl", "Source map URL.").string("outputDir", "Output directory under the project root.").required("sourceMapUrl")),
7
+ tool("sourcemap_parse_v4", (t) => t.desc("Parse source map with ECMA-426 v4 scope/debug-id support; falls back to v3.").string("sourceMapUrl", "Source map URL to parse.").boolean("extractScopes", "Extract and decode scope information from v4 x_scopes field", { default: true }).boolean("extractDebugIds", "Extract debug-id mappings for source correlation", { default: true }).boolean("compareV3", "Compare v4 fields against v3 baseline and report differences", { default: false }).required("sourceMapUrl"))
8
+ ];
9
+ //#endregion
10
+ export { sourcemapTools as t };
@@ -0,0 +1,66 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.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.").number("pid", "Target process ID").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.").number("pid", "Target process ID").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.").number("pid", "Target process ID").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.").number("pid", "Target process ID").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).").number("pid", "Target process ID").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...").number("pid", "Target process ID").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.").number("pid", "Target process ID").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("Attach to an Electron CDP port and optionally evaluate in a matching page.").number("port", "CDP port to connect to", {
61
+ minimum: 1,
62
+ maximum: 65535
63
+ }).string("pageUrl", "Optional URL substring used to pick the target page").string("evaluate", "Optional JavaScript expression to evaluate in the selected page").string("wsEndpoint", "Optional browser WebSocket endpoint override"))
64
+ ];
65
+ //#endregion
66
+ export { processToolDefinitions as t };
@@ -0,0 +1,25 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/maintenance/definitions.ts
3
+ const tokenBudgetTools = [
4
+ tool("get_token_budget_stats", (t) => t.desc("Get token budget usage stats, warnings, and optimization suggestions").query()),
5
+ tool("manual_token_cleanup", (t) => t.desc("Clear stale entries and reset counters to free 10-30% of token budget")),
6
+ tool("reset_token_budget", (t) => t.desc("Hard-reset all token budget counters. Destructive — prefer manual_token_cleanup").destructive())
7
+ ];
8
+ const extensionTools = [
9
+ tool("list_extensions", (t) => t.desc("List all loaded plugins, workflows, and extension tools").query()),
10
+ tool("reload_extensions", (t) => t.desc("Reload plugins and workflows from configured directories").openWorld()),
11
+ tool("browse_extension_registry", (t) => t.desc("Browse the remote jshookmcp extension registry").enum("kind", [
12
+ "plugin",
13
+ "workflow",
14
+ "all"
15
+ ], "Filter by extension kind", { default: "all" }).query()),
16
+ tool("install_extension", (t) => t.desc("Install an extension from the remote registry via git").string("slug", "Extension slug from the registry").string("targetDir", "Target directory override").requiredOpenWorld("slug"))
17
+ ];
18
+ const cacheTools = [
19
+ tool("get_cache_stats", (t) => t.desc("Get cache statistics: entries, sizes, hit rates, and cleanup recommendations").query()),
20
+ tool("smart_cache_cleanup", (t) => t.desc("Evict LRU and stale entries while preserving hot data").number("targetSize", "Target size in bytes")),
21
+ tool("clear_all_caches", (t) => t.desc("Clear all internal caches. Destructive — prefer smart_cache_cleanup").destructive())
22
+ ];
23
+ const artifactTools = [tool("cleanup_artifacts", (t) => t.desc("Clean generated artifacts using age and size retention rules").number("retentionDays", "Override retention window in days").number("maxTotalBytes", "Override maximum retained bytes").boolean("dryRun", "Preview removals without deleting").destructive()), tool("doctor_environment", (t) => t.desc("Run environment doctor for dependencies, bridge endpoints, and platform limitations").boolean("includeBridgeHealth", "Probe native-bridge / Burp endpoints").readOnly())];
24
+ //#endregion
25
+ export { tokenBudgetTools as i, cacheTools as n, extensionTools as r, artifactTools as t };
@@ -0,0 +1,47 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/encoding/definitions.ts
3
+ const encodingTools = [
4
+ tool("binary_detect_format", (t) => t.desc("Detect binary payload format and encoding signals.").enum("source", [
5
+ "base64",
6
+ "hex",
7
+ "file",
8
+ "raw"
9
+ ], "How to interpret input payload").string("data", "Input payload for base64/hex/raw sources").string("filePath", "File path when source=file").string("requestId", "Captured requestId when a response body is available").required("source").query()),
10
+ tool("binary_decode", (t) => t.desc("Decode binary payloads into hex, utf8, or json output").string("data", "Input encoded payload").enum("encoding", [
11
+ "base64",
12
+ "hex",
13
+ "url",
14
+ "protobuf",
15
+ "msgpack"
16
+ ], "Declared input encoding").enum("outputFormat", [
17
+ "hex",
18
+ "utf8",
19
+ "json"
20
+ ], "Target output format", { default: "hex" }).required("data", "encoding").query()),
21
+ tool("binary_encode", (t) => t.desc("Encode utf8/hex/json input into base64/hex/url output").string("data", "Input payload").enum("inputFormat", [
22
+ "utf8",
23
+ "hex",
24
+ "json"
25
+ ], "How to parse input").enum("outputEncoding", [
26
+ "base64",
27
+ "hex",
28
+ "url"
29
+ ], "Desired output encoding").required("data", "inputFormat", "outputEncoding").query()),
30
+ tool("binary_entropy_analysis", (t) => t.desc("Compute entropy and byte frequency for a payload.").enum("source", [
31
+ "base64",
32
+ "hex",
33
+ "raw",
34
+ "file"
35
+ ], "How to interpret input payload").string("data", "Input payload for base64/hex/raw sources").string("filePath", "File path when source=file").number("blockSize", "Block size for per-block entropy", {
36
+ default: 256,
37
+ minimum: 16,
38
+ maximum: 8192
39
+ }).required("source").query()),
40
+ tool("protobuf_decode_raw", (t) => t.desc("Decode base64 protobuf bytes without schema using wire-type aware recursive parser").string("data", "Base64-encoded protobuf payload").number("maxDepth", "Maximum recursive decode depth", {
41
+ default: 5,
42
+ minimum: 1,
43
+ maximum: 20
44
+ }).required("data").query())
45
+ ];
46
+ //#endregion
47
+ export { encodingTools as t };
@@ -0,0 +1,18 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.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,26 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/shared-state-board/definitions.ts
3
+ const sharedStateBoardTools = [
4
+ tool("state_board", (t) => t.desc("Manage shared state board entries.").enum("action", [
5
+ "set",
6
+ "get",
7
+ "delete",
8
+ "list",
9
+ "history",
10
+ "clear"
11
+ ], "Operation to perform").string("key", "Key name (required for set/get/delete/history)").prop("value", {
12
+ type: "object",
13
+ description: "Value to store"
14
+ }).string("namespace", "Namespace for key isolation").number("ttlSeconds", "TTL in seconds").boolean("includeValues", "Include current values in list results", { default: false }).number("limit", "Maximum history entries to return", { default: 50 }).string("keyPattern", "Key pattern filter").required("action")),
15
+ tool("state_board_watch", (t) => t.desc("Start, poll, or stop shared state board watches.").enum("action", [
16
+ "start",
17
+ "poll",
18
+ "stop"
19
+ ], "Watch operation: start watching, poll for changes, or stop watching").string("key", "Key or pattern to watch").string("namespace", "Namespace").number("pollIntervalMs", "Polling interval in milliseconds").string("watchId", "Watch ID").required("action")),
20
+ tool("state_board_io", (t) => t.desc("Export or import state board entries.").enum("action", ["export", "import"], "IO operation").string("namespace", "Namespace filter or target namespace").string("keyPattern", "Key pattern filter").prop("data", {
21
+ type: "object",
22
+ description: "Entries to import"
23
+ }).boolean("overwrite", "Overwrite existing keys on import").required("action"))
24
+ ];
25
+ //#endregion
26
+ export { sharedStateBoardTools as t };
@@ -0,0 +1,37 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.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,27 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.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,14 @@
1
+ import { t as tool } from "./tool-builder-BHJp32mV.mjs";
2
+ //#region src/server/domains/proxy/definitions.ts
3
+ const PROXY_TOOLS = [
4
+ tool("proxy_start", (t) => t.desc("Start the local HTTP/HTTPS proxy.").number("port", "Listen port.", { default: 8080 }).boolean("useHttps", "Enable HTTPS interception.", { default: true })),
5
+ tool("proxy_stop", (t) => t.desc("Stop the proxy.").destructive()),
6
+ tool("proxy_status", (t) => t.desc("Read proxy status and CA path.").query()),
7
+ tool("proxy_export_ca", (t) => t.desc("Read the proxy CA certificate.").query()),
8
+ tool("proxy_add_rule", (t) => t.desc("Add a proxy rule.").string("action", "Rule action: forward, mock_response, or block.").string("method", "HTTP method to match.", { default: "GET" }).string("urlPattern", "URL matcher string or regex literal.").number("mockStatus", "Response status for mock_response.", { default: 200 }).string("mockBody", "Response body for mock_response.").required("action")),
9
+ tool("proxy_get_requests", (t) => t.desc("Read captured proxy requests.").string("urlFilter", "Optional URL filter.").query()),
10
+ tool("proxy_clear_logs", (t) => t.desc("Clear captured proxy logs.").resettable()),
11
+ tool("proxy_setup_adb_device", (t) => t.desc("Configure an Android device to use the proxy.").string("deviceSerial", "ADB device serial."))
12
+ ];
13
+ //#endregion
14
+ export { PROXY_TOOLS as t };