@jshookmcp/jshook 0.2.9 → 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.
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/dist/{AntiCheatDetector-BNk-EoBt.mjs → AntiCheatDetector-CqGDXmfc.mjs} +159 -53
- package/dist/{CodeInjector-Cq8q01kp.mjs → CodeInjector-BdjRfNx7.mjs} +5 -5
- package/dist/{ConsoleMonitor-CPVQW1Y-.mjs → ConsoleMonitor-DykL3IAw.mjs} +85 -17
- package/dist/{DetailedDataManager-BQQcxh64.mjs → DetailedDataManager-HT49OrvF.mjs} +1 -1
- package/dist/{ExtensionManager-CWYgw0YW.mjs → ExtensionManager-BDMsY2Dz.mjs} +15 -8
- package/dist/{HardwareBreakpoint-B9gZCdFP.mjs → HardwareBreakpoint-Cc2AFq1Y.mjs} +3 -3
- package/dist/{HeapAnalyzer-BLDH0dCv.mjs → HeapAnalyzer-DruMgsgj.mjs} +20 -20
- package/dist/{HookGeneratorBuilders.core.generators.storage-CtcdK78Q.mjs → HookGeneratorBuilders.core.generators.storage-CTbB4Lcx.mjs} +1 -74
- package/dist/{InstrumentationSession-CvPC7Jwy.mjs → InstrumentationSession-DLH0vd-z.mjs} +2 -2
- package/dist/{MemoryController-CbVdCIJF.mjs → MemoryController-CMtviNW_.mjs} +3 -3
- package/dist/{MemoryScanSession-BsDZbLYm.mjs → MemoryScanSession-ITgb_NMi.mjs} +2 -2
- package/dist/{MemoryScanner-Bcpml6II.mjs → MemoryScanner-CiL7Z3ey.mjs} +12 -9
- package/dist/{NativeMemoryManager.impl-dZtA1ZGn.mjs → NativeMemoryManager.impl-D9Lkovvn.mjs} +13 -10
- package/dist/{NativeMemoryManager.utils-B-FjA2mJ.mjs → NativeMemoryManager.utils-BBlAixF5.mjs} +1 -1
- package/dist/{PEAnalyzer-D1lzJ_VG.mjs → PEAnalyzer-DMQ44gen.mjs} +15 -15
- package/dist/{PageController-Bqm2kZ_X.mjs → PageController-BPJNqqBN.mjs} +18 -4
- package/dist/{PointerChainEngine-BOhyVsjx.mjs → PointerChainEngine-K7wN8Z-w.mjs} +10 -7
- package/dist/ProcessRegistry-zGg12QbE.mjs +74 -0
- package/dist/{ResponseBuilder-D3iFYx2N.mjs → ResponseBuilder-CJXWmWNw.mjs} +10 -10
- package/dist/{ScriptManager-aHHq0X7U.mjs → ScriptManager-ZuWD-0Jg.mjs} +195 -192
- package/dist/{Speedhack-CqdIFlQl.mjs → Speedhack-D-z0umeT.mjs} +2 -2
- package/dist/{StructureAnalyzer-DhFaPvRO.mjs → StructureAnalyzer-Cav5AVSL.mjs} +9 -6
- package/dist/{ToolCatalog-C0JGZoOm.mjs → ToolCatalog-5OJdMiF0.mjs} +81 -81
- package/dist/{ToolProbe-oC7aPrkv.mjs → ToolProbe-DbCFGyrg.mjs} +1 -1
- package/dist/{ToolRegistry-BjaF4oNz.mjs → ToolRegistry-B9krbTtI.mjs} +51 -2
- package/dist/{ToolRouter.policy-BWV67ZK-.mjs → ToolRouter.policy-BGDAGyeH.mjs} +60 -20
- package/dist/TraceRecorder-B41Z5XBj.mjs +1286 -0
- package/dist/{Win32API-CePkipZY.mjs → Win32API-C2kjj0ze.mjs} +18 -12
- package/dist/{Win32Debug-BvKs-gxc.mjs → Win32Debug-CKrGOTpo.mjs} +2 -2
- package/dist/{WorkflowEngine-CuvkZtWu.mjs → WorkflowEngine-DJ6M4opp.mjs} +226 -255
- package/dist/analysis-BHeJW2Nb.mjs +1234 -0
- package/dist/{antidebug-CqDTB_uk.mjs → antidebug-BRKeyt27.mjs} +3 -3
- package/dist/{artifactRetention-CFEprwPw.mjs → artifactRetention-CPXkUJXp.mjs} +13 -6
- package/dist/{artifacts-Bk2-_uPq.mjs → artifacts-DkfosXH3.mjs} +1 -1
- package/dist/authorization-schema-DRqyJMSk.mjs +31 -0
- package/dist/{binary-instrument-CXfpx6fT.mjs → binary-instrument--V3MAhJ4.mjs} +19 -27
- package/dist/bind-helpers-ClV34xdn.mjs +42 -0
- package/dist/{boringssl-inspector-BH2D3VKc.mjs → boringssl-inspector-Bo_LOLaS.mjs} +1 -1
- package/dist/{browser-BpOr5PEx.mjs → browser-Dx3_S2cG.mjs} +324 -37
- package/dist/capabilities-CcHlvWgK.mjs +33 -0
- package/dist/{constants-B0OANIBL.mjs → constants-CDZLOoVv.mjs} +18 -3
- package/dist/{coordination-qUbyF8KU.mjs → coordination-DgItD9DL.mjs} +2 -2
- package/dist/{debugger-gnKxRSN0.mjs → debugger-RS3RSAqs.mjs} +30 -13
- package/dist/definitions-BEoYofW5.mjs +47 -0
- package/dist/{definitions-bAhHQJq9.mjs → definitions-BRaefg3u.mjs} +11 -5
- package/dist/{definitions-DVGfrn7y.mjs → definitions-BbkvZkiv.mjs} +2 -2
- package/dist/definitions-BtWSHJ3o.mjs +17 -0
- package/dist/{definitions-BMfYXoNC.mjs → definitions-C1gCHO0i.mjs} +1 -1
- package/dist/{definitions-C1UvM5Iy.mjs → definitions-CDOg_b-l.mjs} +14 -2
- package/dist/definitions-CVPD9hzZ.mjs +54 -0
- package/dist/{definitions-Cke7zEb8.mjs → definitions-Cea8Lgl7.mjs} +1 -1
- package/dist/definitions-DAgIyjxM.mjs +10 -0
- package/dist/{definitions-B4rAvHNZ.mjs → definitions-DJA27nsL.mjs} +12 -9
- package/dist/{definitions-ClJLzsJQ.mjs → definitions-DKPFU3LW.mjs} +1 -1
- package/dist/{definitions-D3VsGcvz.mjs → definitions-DPRpZQ96.mjs} +7 -7
- package/dist/{definitions-B18eyf0B.mjs → definitions-DUE5gmdn.mjs} +1 -1
- package/dist/definitions-DYVjOtxa.mjs +26 -0
- package/dist/{definitions-BB_4jnmy.mjs → definitions-DcYLVLCo.mjs} +1 -1
- package/dist/{definitions-Beid2EB3.mjs → definitions-Pp5LI2H4.mjs} +1 -1
- package/dist/definitions-j9KdHVNR.mjs +14 -0
- package/dist/definitions-uzkjBwa7.mjs +258 -0
- package/dist/{definitions-Cq-zroAU.mjs → definitions-va-AnLuQ.mjs} +4 -4
- package/dist/{encoding-Bvz5jLRv.mjs → encoding-DJeqHmpd.mjs} +18 -4
- package/dist/{evidence-graph-bridge-C_fv9PuC.mjs → evidence-graph-bridge-DcYizFk2.mjs} +1 -0
- package/dist/{factory-DxlGh9Xf.mjs → factory-C90tBff6.mjs} +6 -6
- package/dist/flat-target-session-Dgax2Cy3.mjs +29 -0
- package/dist/{graphql-DYWzJ29s.mjs → graphql-CoHrhweh.mjs} +205 -34
- package/dist/{handlers-C67ktuRN.mjs → handlers-4jmR0nMs.mjs} +220 -32
- package/dist/{handlers-DlCJN4Td.mjs → handlers-BAHPxcch.mjs} +122 -90
- package/dist/{handlers-9sAbfIg-.mjs → handlers-BOs9b907.mjs} +849 -801
- package/dist/{handlers-DxGIq15_2.mjs → handlers-BWXEy6ef.mjs} +16 -16
- package/dist/{handlers-tB9Mp9ZK.mjs → handlers-Bndn6QvE.mjs} +31 -4
- package/dist/{handlers-CTsDAO6p.mjs → handlers-BqC4bD4s.mjs} +1 -1
- package/dist/{handlers-C87g8oCe.mjs → handlers-BtYq60bM2.mjs} +1 -1
- package/dist/{handlers-DeLOCd5m.mjs → handlers-BzgcB4iv.mjs} +17 -17
- package/dist/{handlers-Cgyg6c0U.mjs → handlers-CRyRWj2b.mjs} +237 -23
- package/dist/{handlers-U6L4xhuF.mjs → handlers-CVv2H1uq.mjs} +24 -17
- package/dist/{handlers-tiy7EIBp.mjs → handlers-Dl5a7JS4.mjs} +3 -3
- package/dist/{handlers-D6j6yka7.mjs → handlers-Dx2d7jt7.mjs} +1893 -1480
- package/dist/{handlers-Bl8zkwz1.mjs → handlers-Dz9PYsCa.mjs} +95 -6
- package/dist/handlers-HujRKC3b.mjs +661 -0
- package/dist/{handlers.impl-DS0d9fUw.mjs → handlers.impl-XWXkQfyi.mjs} +70 -24
- package/dist/{hooks-CzCWByww.mjs → hooks-B1B8NRHL.mjs} +3 -3
- package/dist/index.mjs +154 -144
- package/dist/{maintenance-P7ePRXQC.mjs → maintenance-PRMkLVRW.mjs} +35 -30
- package/dist/manifest-67Bok-Si.mjs +58 -0
- package/dist/{manifest-B3QVVeBS.mjs → manifest-6lNTMZAB2.mjs} +33 -28
- package/dist/manifest-B2duEHiH.mjs +90 -0
- package/dist/manifest-B6EY9Vm8.mjs +57 -0
- package/dist/{manifest-gZ4s_UtG.mjs → manifest-B6nKSbyY.mjs} +32 -33
- package/dist/{manifest-2ToTpjv8.mjs → manifest-BL8AQNPF.mjs} +31 -31
- package/dist/{manifest-DzwvxPJX.mjs → manifest-BSZvJJmV.mjs} +23 -14
- package/dist/{manifest-Sc_0JQ13.mjs → manifest-BU7qzUyX.mjs} +23 -23
- package/dist/{manifest-CT7zZBV1.mjs → manifest-Bl62e8WK.mjs} +24 -23
- package/dist/manifest-Bo5cXjdt.mjs +82 -0
- package/dist/manifest-BpS4gtUK.mjs +1347 -0
- package/dist/manifest-Bv65_e2W.mjs +101 -0
- package/dist/manifest-BytNIF4Z.mjs +117 -0
- package/dist/{manifest-BqrQ4Tpj.mjs → manifest-C-xtsjS3.mjs} +23 -23
- package/dist/{manifest-NXctwWQq.mjs → manifest-CDYl7OhA.mjs} +36 -38
- package/dist/manifest-CRZ3xmkD.mjs +61 -0
- package/dist/manifest-CoW6u4Tp.mjs +132 -0
- package/dist/manifest-Cq5zN_8A.mjs +50 -0
- package/dist/{manifest-CAhOuvSl.mjs → manifest-D7YZM_2e.mjs} +75 -85
- package/dist/{manifest-DCyjf4n2.mjs → manifest-DE_VrAeQ.mjs} +27 -7
- package/dist/manifest-DGsXSCpT.mjs +39 -0
- package/dist/{manifest-BB2J8IMJ.mjs → manifest-DJ2vfEuW.mjs} +48 -41
- package/dist/{manifest-3g71z6Bg.mjs → manifest-DPXDYhEu.mjs} +26 -25
- package/dist/manifest-Dd4fQb0a.mjs +322 -0
- package/dist/{manifest-CXsRWjjI.mjs → manifest-Deq6opGg.mjs} +95 -96
- package/dist/{manifest-C9RT5nk32.mjs → manifest-DfJTafJK.mjs} +14 -11
- package/dist/manifest-DgOdgN_j.mjs +50 -0
- package/dist/{manifest-BmtZzQiQ2.mjs → manifest-DlbMW4v4.mjs} +17 -15
- package/dist/{manifest-DrbmZcFl2.mjs → manifest-DmVfbH0w.mjs} +212 -91
- package/dist/manifest-Dog6Ddjr.mjs +109 -0
- package/dist/manifest-DvgU5FWb.mjs +58 -0
- package/dist/manifest-HsfDBs7j.mjs +50 -0
- package/dist/manifest-I8oQHvCG.mjs +186 -0
- package/dist/manifest-NvH_a-av.mjs +786 -0
- package/dist/{manifest-Dh8WBmEW.mjs → manifest-cEJU1v0Z.mjs} +24 -24
- package/dist/manifest-wOl5XLB12.mjs +112 -0
- package/dist/{modules-C184v-S9.mjs → modules-tZozf0LQ.mjs} +130 -860
- package/dist/{mojo-ipc-B_H61Afw.mjs → mojo-ipc-DXNEXEqb.mjs} +141 -26
- package/dist/{network-671Cw6hV.mjs → network-CPVvwvFg.mjs} +1329 -823
- package/dist/{outputPaths-B1uGmrWZ.mjs → outputPaths-um7lCRY3.mjs} +4 -8
- package/dist/{platform-WmNn8Sxb.mjs → platform-CYeFoTWp.mjs} +101 -10
- package/dist/{process-QcbIy5Zq.mjs → process-BTbgcVc6.mjs} +251 -346
- package/dist/{proxy-DqNs0bAd.mjs → proxy-r8YN6nP1.mjs} +30 -8
- package/dist/{registry-D-6e18lB.mjs → registry-Bl8ZQW61.mjs} +3 -3
- package/dist/{response-BQVP-xUn.mjs → response-CWhh2aLo.mjs} +7 -1
- package/dist/{shared-state-board-DV-dpHFJ.mjs → shared-state-board-BoZnSoj-.mjs} +2 -2
- package/dist/{sourcemap-Dq8ez8vS.mjs → sourcemap-BIDHUVXy.mjs} +350 -66
- package/dist/{streaming-BUQ0VJsg.mjs → streaming-Dal6utPp.mjs} +13 -13
- package/dist/{tool-builder-DCbIC5Eo.mjs → tool-builder-BHJp32mV.mjs} +1 -1
- package/dist/{transform-CiYJfNX0.mjs → transform-DRVgGG90.mjs} +18 -14
- package/dist/wasm-BYx5UOeG.mjs +1044 -0
- package/dist/webcrack-Be0_FccV.mjs +747 -0
- package/dist/{workflow-f3xJOcjx.mjs → workflow-BpuKEtvn.mjs} +8 -8
- package/package.json +76 -43
- package/dist/TraceRecorder-DgxyVbdQ.mjs +0 -519
- package/dist/analysis-CL9uACt9.mjs +0 -463
- package/dist/bind-helpers-xFfRF-qm.mjs +0 -22
- package/dist/definitions-6M-eejaT.mjs +0 -53
- package/dist/definitions-B3QdlrHv.mjs +0 -34
- package/dist/definitions-CXEI7QC72.mjs +0 -216
- package/dist/definitions-C_4r7Fo-2.mjs +0 -14
- package/dist/definitions-CkFDALoa.mjs +0 -26
- package/dist/definitions-Cy3Sl6gV.mjs +0 -34
- package/dist/definitions-LKpC3-nL.mjs +0 -9
- package/dist/handlers-DdFzXLvF.mjs +0 -446
- package/dist/manifest-82baTv4U.mjs +0 -45
- package/dist/manifest-BKbgbSiY.mjs +0 -60
- package/dist/manifest-Bcf-TJzH.mjs +0 -848
- package/dist/manifest-Bnd7kqEY.mjs +0 -55
- package/dist/manifest-BqQX6OQC2.mjs +0 -65
- package/dist/manifest-Br4RPFt5.mjs +0 -370
- package/dist/manifest-C5qDjysN.mjs +0 -107
- package/dist/manifest-CBYWCUBJ.mjs +0 -51
- package/dist/manifest-CFADCRa1.mjs +0 -37
- package/dist/manifest-CQVhavRF.mjs +0 -114
- package/dist/manifest-CV12bcrF.mjs +0 -121
- package/dist/manifest-CZLUCfG02.mjs +0 -95
- package/dist/manifest-D6phHKFd.mjs +0 -131
- package/dist/manifest-DHsnKgP6.mjs +0 -60
- package/dist/manifest-Df_dliIe.mjs +0 -55
- package/dist/manifest-DhKRAT8_.mjs +0 -92
- package/dist/manifest-DlpTj4ic2.mjs +0 -193
- package/dist/manifest-DuwHjUa5.mjs +0 -70
- package/dist/manifest-qSleDqdO.mjs +0 -1023
- package/dist/wasm-DQTnHDs4.mjs +0 -531
- /package/dist/{CacheAdapters-CDe5WPSV.mjs → CacheAdapters-jJFy20G-.mjs} +0 -0
- /package/dist/{DarwinAPI-BNPxu0RH.mjs → DarwinAPI-ETyy0xyo.mjs} +0 -0
- /package/dist/{EventBus-DgPmwpeu.mjs → EventBus-DFKvADm3.mjs} +0 -0
- /package/dist/{EvidenceGraphBridge-SFesNera.mjs → EvidenceGraphBridge-318Oi0Lf.mjs} +0 -0
- /package/dist/{FingerprintManager-gzWtkKuf.mjs → FingerprintManager-BN4UQWnX.mjs} +0 -0
- /package/dist/{PrerequisiteError-Dl33Svkz.mjs → PrerequisiteError-TuyZIs6n.mjs} +0 -0
- /package/dist/{ReverseEvidenceGraph-Dlsk94LC.mjs → ReverseEvidenceGraph-C02-gXOh.mjs} +0 -0
- /package/dist/{StealthVerifier-Bo4T3bz8.mjs → StealthVerifier-BWmPgQsv.mjs} +0 -0
- /package/dist/{VersionDetector-CwVLVdDM.mjs → VersionDetector-K3V4vGsw.mjs} +0 -0
- /package/dist/{betterSqlite3-0pqusHHH.mjs → betterSqlite3-DLSBZodi.mjs} +0 -0
- /package/dist/{concurrency-Bt0yv1kJ.mjs → concurrency-Drev_Vz9.mjs} +0 -0
- /package/dist/{formatAddress-DVkj9kpI.mjs → formatAddress-nnMvEohD.mjs} +0 -0
- /package/dist/{parse-args-BlRjqlkL.mjs → parse-args-B4cY5Vx5.mjs} +0 -0
- /package/dist/{ssrf-policy-ZaUfvhq7.mjs → ssrf-policy-Dsqd-DTX.mjs} +0 -0
- /package/dist/{types-CPhOReNX.mjs → types-DDBWs9UP.mjs} +0 -0
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
|
|
2
|
-
//#region src/server/domains/network/definitions.ts
|
|
3
|
-
const networkAuthorizationSchema = {
|
|
4
|
-
allowedHosts: {
|
|
5
|
-
type: "array",
|
|
6
|
-
items: { type: "string" },
|
|
7
|
-
description: "Exact hostnames or IP literals allowed for this request."
|
|
8
|
-
},
|
|
9
|
-
allowedCidrs: {
|
|
10
|
-
type: "array",
|
|
11
|
-
items: { type: "string" },
|
|
12
|
-
description: "Explicit CIDR ranges allowed for this request."
|
|
13
|
-
},
|
|
14
|
-
allowPrivateNetwork: {
|
|
15
|
-
type: "boolean",
|
|
16
|
-
description: "Allow access to private or reserved network targets, but only when the resolved host matches allowedHosts or allowedCidrs."
|
|
17
|
-
},
|
|
18
|
-
allowInsecureHttp: {
|
|
19
|
-
type: "boolean",
|
|
20
|
-
description: "Allow plain HTTP access to explicitly authorized targets in allowedHosts or allowedCidrs."
|
|
21
|
-
},
|
|
22
|
-
expiresAt: {
|
|
23
|
-
type: "string",
|
|
24
|
-
description: "Optional ISO-8601 expiry time for this authorization."
|
|
25
|
-
},
|
|
26
|
-
reason: {
|
|
27
|
-
type: "string",
|
|
28
|
-
description: "Short audit note describing why this authorization is needed."
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const advancedTools = [
|
|
32
|
-
tool("network_enable", (t) => t.desc("Enable network request monitoring. Must be called before page_navigate to capture requests.\n\nCorrect order:\n1. network_enable()\n2. page_navigate(\"https://example.com\")\n3. network_get_requests()\n\nOr use enableNetworkMonitoring parameter on page_navigate.").boolean("enableExceptions", "Also capture uncaught exceptions", { default: true })),
|
|
33
|
-
tool("network_disable", (t) => t.desc("Disable network request monitoring").destructive()),
|
|
34
|
-
tool("network_get_status", (t) => t.desc("Get network monitoring status (enabled, request count, response count)").query()),
|
|
35
|
-
tool("network_monitor", (t) => t.desc("Manage network request monitoring. Enable/disable monitoring or check status. Must enable before page_navigate to capture requests.").enum("action", [
|
|
36
|
-
"enable",
|
|
37
|
-
"disable",
|
|
38
|
-
"status"
|
|
39
|
-
], "Action to perform").boolean("enableExceptions", "Only for enable action: Also capture uncaught exceptions", { default: true }).required("action")),
|
|
40
|
-
tool("network_get_requests", (t) => t.desc("Get captured network requests. Large results (>25KB) automatically return a summary with detailId.\n\nPrerequisites:\n1. Call network_enable first\n2. Navigate to a page\n\nResponse fields:\n- requestId: unique request identifier\n- url: request URL\n- method: HTTP method (GET/POST)\n- headers: request headers\n- postData: POST body (if present)\n- timestamp: capture time\n- type: resource type (Document/Script/XHR)\n\nDefault behavior:\n- Static resources (Image/Font/Stylesheet/Media) are excluded when no filters are set\n- Results are sorted by type priority: XHR > Fetch > Document > Script > Other\n- Set any filter (url, method, etc.) to include all resource types\n\nBest practices:\n1. Use url filter to reduce result size\n2. Use offset+limit for pagination instead of multiple get_detailed_data calls\n3. Use get_detailed_data(detailId) for full data when summary is returned\n4. If 0 results returned, call console_inject_fetch_interceptor() then re-navigate to capture frontend-wrapped fetch/XHR calls").string("url", "Filter by URL substring (e.g., \"api\" matches all API URLs)").string("urlRegex", "Filter by URL regex pattern (e.g., \"/api/(v[12]|auth)/\"). Takes precedence over url substring.").string("method", "Filter by HTTP method (GET, POST, PUT, DELETE)").number("sinceTimestamp", "Only return requests after this epoch timestamp (milliseconds). Useful for incremental polling.").string("sinceRequestId", "Only return requests after this requestId (exclusive). Useful for incremental retrieval.").number("tail", "Return the last N requests (applied after all other filters). E.g., tail=5 returns the 5 most recent.").number("limit", "Maximum number of results per page (default: 100, max: 1000)", {
|
|
41
|
-
default: 100,
|
|
42
|
-
minimum: 1,
|
|
43
|
-
maximum: 1e3
|
|
44
|
-
}).number("offset", "Skip first N results for pagination (default: 0). Use page.nextOffset from previous response.", {
|
|
45
|
-
default: 0,
|
|
46
|
-
minimum: 0
|
|
47
|
-
}).boolean("autoEnable", "Auto-enable network monitoring when currently disabled", { default: true }).boolean("enableExceptions", "When autoEnable=true, also enable uncaught exception monitoring", { default: true })),
|
|
48
|
-
tool("network_get_response_body", (t) => t.desc("Get response body for a specific request. Auto-truncates responses >100KB. Use returnSummary=true for large files.").string("requestId", "Request ID (from network_get_requests)").number("maxSize", "Maximum response size in bytes", {
|
|
49
|
-
default: 1e5,
|
|
50
|
-
minimum: 1024,
|
|
51
|
-
maximum: 2e7
|
|
52
|
-
}).boolean("returnSummary", "Return only size and preview instead of full body", { default: false }).number("retries", "Retry count when response body is not yet available", {
|
|
53
|
-
default: 3,
|
|
54
|
-
minimum: 0,
|
|
55
|
-
maximum: 10
|
|
56
|
-
}).number("retryIntervalMs", "Retry interval in milliseconds", {
|
|
57
|
-
default: 500,
|
|
58
|
-
minimum: 100,
|
|
59
|
-
maximum: 1e4
|
|
60
|
-
}).boolean("autoEnable", "Auto-enable network monitoring when currently disabled", { default: false }).boolean("enableExceptions", "When autoEnable=true, also enable uncaught exception monitoring", { default: true }).required("requestId")),
|
|
61
|
-
tool("network_get_stats", (t) => t.desc("Get network statistics (total requests, response count, error rate, timing)").query()),
|
|
62
|
-
tool("performance_get_metrics", (t) => t.desc("Get page performance metrics (Web Vitals: FCP, LCP, FID, CLS)").boolean("includeTimeline", "Include detailed timeline events", { default: false }).query()),
|
|
63
|
-
tool("performance_coverage", (t) => t.desc("Start or stop JavaScript and CSS code coverage recording").enum("action", ["start", "stop"], "Coverage action").required("action")),
|
|
64
|
-
tool("performance_take_heap_snapshot", (t) => t.desc("Take a V8 heap memory snapshot")),
|
|
65
|
-
tool("performance_trace", (t) => t.desc(`Chrome Performance Trace recording. Action 'start' begins capture; 'stop' ends and saves trace file.
|
|
66
|
-
|
|
67
|
-
Captures timeline events (JS execution, layout, paint, rendering) loadable in Chrome DevTools Performance tab.`).enum("action", ["start", "stop"], "Trace action").array("categories", { type: "string" }, "Trace categories (action=start, default: devtools.timeline, v8.execute)").boolean("screenshots", "Capture screenshots during tracing (action=start, default: false)", { default: false }).string("artifactPath", "Custom output path (action=stop)").required("action")),
|
|
68
|
-
tool("profiler_cpu", (t) => t.desc(`CDP CPU profiling. Action 'start' begins recording; 'stop' ends and saves profile with top hot functions.`).enum("action", ["start", "stop"], "Profiler action").string("artifactPath", "Custom output path (action=stop)").required("action")),
|
|
69
|
-
tool("profiler_heap_sampling", (t) => t.desc(`V8 heap allocation sampling. Action 'start' begins tracking; 'stop' ends and returns top allocators.`).enum("action", ["start", "stop"], "Sampling action").number("samplingInterval", "Sampling interval bytes (action=start, default: 32768)", {
|
|
70
|
-
default: 32768,
|
|
71
|
-
minimum: 256,
|
|
72
|
-
maximum: 1048576
|
|
73
|
-
}).string("artifactPath", "Custom output path (action=stop)").number("topN", "Number of top allocators (action=stop, default: 20)", {
|
|
74
|
-
default: 20,
|
|
75
|
-
minimum: 1,
|
|
76
|
-
maximum: 100
|
|
77
|
-
}).required("action")),
|
|
78
|
-
tool("console_get_exceptions", (t) => t.desc("Get captured uncaught exceptions from the page").string("url", "Filter by URL substring").number("limit", "Maximum number of exceptions to return", {
|
|
79
|
-
default: 50,
|
|
80
|
-
minimum: 1,
|
|
81
|
-
maximum: 1e3
|
|
82
|
-
}).readOnly()),
|
|
83
|
-
tool("console_inject", (t) => t.desc(`Inject an in-page monitor/interceptor. Types:
|
|
84
|
-
- script: Track dynamically created script elements
|
|
85
|
-
- xhr: Capture AJAX request/response data
|
|
86
|
-
- fetch: Capture fetch() calls (useful when CDP misses wrapped fetch)
|
|
87
|
-
- function: Proxy-based tracer for a named global function (requires functionName)`).enum("type", [
|
|
88
|
-
"script",
|
|
89
|
-
"xhr",
|
|
90
|
-
"fetch",
|
|
91
|
-
"function"
|
|
92
|
-
], "Injection type").string("functionName", "Global function path to trace (type=function, e.g. \"window.someFunction\")").boolean("persistent", "Survive page navigations via evaluateOnNewDocument (default: false)", { default: false }).required("type").openWorld()),
|
|
93
|
-
tool("console_buffers", (t) => t.desc("Manage injected interceptor state.").enum("action", ["clear", "reset"], "Buffer action: clear buffers or reset interceptors").required("action")),
|
|
94
|
-
tool("http_request_build", (t) => t.desc("Build a raw HTTP/1.x request payload with CRLF line endings. Useful for preparing deterministic request text for http_plain_request or other raw socket tools.").string("method", "HTTP method token, e.g. GET, POST, HEAD").string("target", "Request target, such as /path, *, or an absolute-form URL").string("host", "Optional Host header value to inject when addHostHeader is enabled").object("headers", { additionalProperties: { type: "string" } }, "Optional HTTP headers to include in the request").string("body", "Optional UTF-8 request body").enum("httpVersion", ["1.0", "1.1"], "HTTP protocol version to emit. Default: 1.1", { default: "1.1" }).boolean("addHostHeader", "Auto-add the Host header when host is provided", { default: true }).boolean("addContentLength", "Auto-add Content-Length when a body is present and Transfer-Encoding is absent", { default: true }).boolean("addConnectionClose", "Auto-add Connection: close when absent", { default: true }).requiredOpenWorld("method", "target")),
|
|
95
|
-
tool("http_plain_request", (t) => t.desc("Send a raw HTTP request over plain TCP using deterministic server-side logic with DNS pinning, response parsing, and bounded capture. Non-loopback HTTP targets require explicit request-scoped authorization.").string("host", "Target hostname or IP literal").number("port", "TCP port to connect to. Default: 80", {
|
|
96
|
-
default: 80,
|
|
97
|
-
minimum: 1,
|
|
98
|
-
maximum: 65535
|
|
99
|
-
}).string("requestText", "Raw HTTP request text to send as UTF-8 bytes").object("authorization", networkAuthorizationSchema, "Request-scoped authorization policy for private-network or insecure-HTTP targets. Use exact hosts/CIDRs instead of process-wide bypasses.").number("timeoutMs", "Socket timeout in milliseconds", {
|
|
100
|
-
default: 3e4,
|
|
101
|
-
minimum: 1e3,
|
|
102
|
-
maximum: 12e4
|
|
103
|
-
}).number("maxResponseBytes", "Maximum number of raw response bytes to capture before truncating the exchange", {
|
|
104
|
-
default: 512e3,
|
|
105
|
-
minimum: 1024,
|
|
106
|
-
maximum: 10485760
|
|
107
|
-
}).requiredOpenWorld("host", "requestText")),
|
|
108
|
-
tool("http2_probe", (t) => t.desc("Probe an HTTP/2 endpoint using Node http2 with deterministic DNS pinning and bounded response capture. Reports the negotiated protocol, ALPN result, response headers, status, and a response body snippet. Non-loopback plaintext h2c targets require explicit request-scoped authorization.").string("url", "Absolute http:// or https:// URL to probe").string("method", "HTTP method token to send. Default: GET").object("headers", { additionalProperties: { type: "string" } }, "Optional request headers to include. Header names are normalized to lowercase for HTTP/2.").string("body", "Optional UTF-8 request body to send with the probe").array("alpnProtocols", { type: "string" }, "Optional ALPN preference list for TLS probes. Default: [\"h2\", \"http/1.1\"].").object("authorization", networkAuthorizationSchema, "Request-scoped authorization policy for private-network or insecure-HTTP targets. Use exact hosts/CIDRs instead of process-wide bypasses.").number("timeoutMs", "Probe timeout in milliseconds", {
|
|
109
|
-
default: 3e4,
|
|
110
|
-
minimum: 1e3,
|
|
111
|
-
maximum: 12e4
|
|
112
|
-
}).number("maxBodyBytes", "Maximum number of response body bytes to capture for the snippet before truncating", {
|
|
113
|
-
default: 32768,
|
|
114
|
-
minimum: 1024,
|
|
115
|
-
maximum: 1048576
|
|
116
|
-
}).requiredOpenWorld("url")),
|
|
117
|
-
tool("http2_frame_build", (t) => t.desc("Build a raw HTTP/2 binary frame of any supported type (DATA, SETTINGS, PING, WINDOW_UPDATE, RST_STREAM, GOAWAY, or RAW). Returns the 9-byte frame header and full frame as hex strings, ready to send over a tcp_write or tls_write channel for protocol-level fuzzing and injection.").string("frameType", "HTTP/2 frame type: DATA, SETTINGS, PING, WINDOW_UPDATE, RST_STREAM, GOAWAY, or RAW").number("streamId", "Stream identifier (0 for connection-level frames). Default: 0", {
|
|
118
|
-
default: 0,
|
|
119
|
-
minimum: 0,
|
|
120
|
-
maximum: 2147483647
|
|
121
|
-
}).number("flags", "Raw flags byte (0-255). Overrides type-specific defaults when set.", {
|
|
122
|
-
minimum: 0,
|
|
123
|
-
maximum: 255
|
|
124
|
-
}).number("frameTypeCode", "Explicit frame type code for RAW frames (0-255). Required when frameType is RAW.", {
|
|
125
|
-
minimum: 0,
|
|
126
|
-
maximum: 255
|
|
127
|
-
}).string("payloadHex", "Frame payload as a hex string. Mutually exclusive with payloadText.").string("payloadText", "Frame payload as a text string. Mutually exclusive with payloadHex.").string("payloadEncoding", "Encoding for payloadText: utf8 or ascii. Default: utf8").array("settings", {
|
|
128
|
-
type: "object",
|
|
129
|
-
properties: {
|
|
130
|
-
id: { type: "number" },
|
|
131
|
-
value: { type: "number" }
|
|
132
|
-
},
|
|
133
|
-
required: ["id", "value"]
|
|
134
|
-
}, "Array of {id, value} entries for SETTINGS frames").boolean("ack", "Set the ACK flag on SETTINGS or PING frames").string("pingOpaqueDataHex", "Exactly 8 bytes of opaque data for PING frames (hex string)").number("windowSizeIncrement", "Window size increment for WINDOW_UPDATE frames (1 to 2^31-1)").number("errorCode", "Error code for RST_STREAM or GOAWAY frames (0 to 2^32-1)").number("lastStreamId", "Last stream ID for GOAWAY frames (0 to 2^31-1)").string("debugDataText", "Optional debug data for GOAWAY frames").string("debugDataEncoding", "Encoding for debugDataText: utf8 or ascii. Default: utf8").requiredOpenWorld("frameType")),
|
|
135
|
-
tool("network_rtt_measure", (t) => t.desc("Measure round-trip time (RTT) to a target URL using TCP, TLS, or HTTP probes. Returns per-sample latencies and aggregate statistics (min/max/mean/median/p95).").string("url", "Target URL to measure RTT to").string("probeType", "Probe type: tcp, tls, or http. Default: tcp", { default: "tcp" }).number("iterations", "Number of probe iterations (1-50). Default: 5", {
|
|
136
|
-
default: 5,
|
|
137
|
-
minimum: 1,
|
|
138
|
-
maximum: 50
|
|
139
|
-
}).number("timeoutMs", "Per-probe timeout in milliseconds (100-30000). Default: 5000", {
|
|
140
|
-
default: 5e3,
|
|
141
|
-
minimum: 100,
|
|
142
|
-
maximum: 3e4
|
|
143
|
-
}).object("authorization", { additionalProperties: { type: "string" } }, "Authorization policy for network access").requiredOpenWorld("url")),
|
|
144
|
-
tool("network_extract_auth", (t) => t.desc("Scan all captured network requests and extract authentication credentials (tokens, cookies, API keys, signatures).\n\nReturns masked values (first 6 + last 4 chars) sorted by confidence.\nSources scanned: request headers, cookies, URL query params, JSON request body.\n\nUSE THIS after capturing traffic to automatically identify:\n- Bearer tokens / JWT tokens\n- Session cookies\n- Custom auth headers (X-Token, X-Signature, X-Api-Key)\n- Signing parameters in request body or query string").number("minConfidence", "Minimum confidence threshold 0-1", {
|
|
145
|
-
default: .4,
|
|
146
|
-
minimum: 0,
|
|
147
|
-
maximum: 1
|
|
148
|
-
})),
|
|
149
|
-
tool("network_export_har", (t) => t.desc("Export all captured network traffic as a standard HAR 1.2 file.\n\nHAR (HTTP Archive) files can be opened in:\n- Chrome DevTools (Network tab → Import)\n- Fiddler, Charles Proxy, Wireshark\n- Online HAR viewers\n\nUSE THIS to:\n- Save a complete traffic snapshot for offline analysis\n- Share captured API calls with other tools\n- Reproduce a full session outside the browser").string("outputPath", "File path to write the HAR file. If omitted, returns HAR as JSON.").boolean("includeBodies", "Include response bodies in the HAR (may be slow for large captures). Default: false", { default: false }).openWorld()),
|
|
150
|
-
tool("network_replay_request", (t) => t.desc("Replay a previously captured network request with optional modifications.\n\nUSE THIS to:\n- Re-send an API call with modified headers (e.g., different auth token)\n- Test how a server responds to altered request bodies\n- Verify that a captured signature is still valid\n- Reproduce a specific API call without navigating again\n\nSecurity: dryRun=true (default) previews what will be sent without actually sending.\nSet dryRun=false to execute the actual request.").string("requestId", "Request ID from network_get_requests to replay").object("headerPatch", { additionalProperties: { type: "string" } }, "Headers to add or override (key-value pairs)").string("bodyPatch", "Replace the entire request body with this string").string("methodOverride", "Override the HTTP method (e.g., change POST to GET)").string("urlOverride", "Override the request URL").object("authorization", networkAuthorizationSchema, "Request-scoped authorization policy for private-network or insecure-HTTP replay. Use exact hosts/CIDRs instead of process-wide bypasses.").string("authorizationCapability", "Base64url-encoded JSON capability for request-scoped authorization. Payload fields mirror authorization and must include requestId.").number("timeoutMs", "Request timeout in milliseconds", {
|
|
151
|
-
default: 3e4,
|
|
152
|
-
minimum: 1e3,
|
|
153
|
-
maximum: 12e4
|
|
154
|
-
}).boolean("dryRun", "If true (default), only preview the request without sending. Set false to execute.", { default: true }).requiredOpenWorld("requestId")),
|
|
155
|
-
tool("network_traceroute", (t) => t.desc("ICMP traceroute with per-hop RTT and error classification. Windows: no admin required. Linux/macOS: requires root or CAP_NET_RAW.").string("target", "Target IP address to trace route to").number("maxHops", "Maximum number of hops (1-64). Default: 30", {
|
|
156
|
-
default: 30,
|
|
157
|
-
minimum: 1,
|
|
158
|
-
maximum: 64
|
|
159
|
-
}).number("timeout", "Per-hop timeout in milliseconds (100-30000). Default: 5000", {
|
|
160
|
-
default: 5e3,
|
|
161
|
-
minimum: 100,
|
|
162
|
-
maximum: 3e4
|
|
163
|
-
}).number("packetSize", "ICMP echo request payload size in bytes (8-65500). Default: 32", {
|
|
164
|
-
default: 32,
|
|
165
|
-
minimum: 8,
|
|
166
|
-
maximum: 65500
|
|
167
|
-
}).required("target").query()),
|
|
168
|
-
tool("network_icmp_probe", (t) => t.desc("ICMP echo probe with TTL control and error classification. Windows: no admin required. Linux/macOS: requires root or CAP_NET_RAW.").string("target", "Target IP address to probe").number("ttl", "Time-to-live value (1-255). Default: 128", {
|
|
169
|
-
default: 128,
|
|
170
|
-
minimum: 1,
|
|
171
|
-
maximum: 255
|
|
172
|
-
}).number("packetSize", "ICMP echo request payload size in bytes (8-65500). Default: 32", {
|
|
173
|
-
default: 32,
|
|
174
|
-
minimum: 8,
|
|
175
|
-
maximum: 65500
|
|
176
|
-
}).number("timeout", "Timeout in milliseconds (100-30000). Default: 5000", {
|
|
177
|
-
default: 5e3,
|
|
178
|
-
minimum: 100,
|
|
179
|
-
maximum: 3e4
|
|
180
|
-
}).required("target").query()),
|
|
181
|
-
tool("network_intercept", (t) => t.desc(`Manage response interception rules using CDP Fetch domain. Actions: add (create rule), list (show active rules), disable (remove rules).
|
|
182
|
-
|
|
183
|
-
When adding rules, matched requests receive a custom response instead of the real server response.
|
|
184
|
-
URL patterns support glob (* for segment, ** for any) and regex.
|
|
185
|
-
When all rules are removed, the CDP Fetch domain is automatically disabled.`).enum("action", [
|
|
186
|
-
"add",
|
|
187
|
-
"list",
|
|
188
|
-
"disable"
|
|
189
|
-
], "Intercept operation").string("urlPattern", "URL pattern to match (action=add). Supports glob (* = segment, ** = any) or regex.").enum("urlPatternType", ["glob", "regex"], "How to interpret urlPattern", { default: "glob" }).enum("stage", ["Request", "Response"], "Intercept stage. Response (default) intercepts after server responds.", { default: "Response" }).number("responseCode", "HTTP status code to return", {
|
|
190
|
-
default: 200,
|
|
191
|
-
minimum: 100,
|
|
192
|
-
maximum: 599
|
|
193
|
-
}).object("responseHeaders", { additionalProperties: { type: "string" } }, "Custom response headers as key-value pairs.").string("responseBody", "Custom response body string.").array("rules", {
|
|
194
|
-
type: "object",
|
|
195
|
-
properties: {
|
|
196
|
-
urlPattern: { type: "string" },
|
|
197
|
-
urlPatternType: {
|
|
198
|
-
type: "string",
|
|
199
|
-
enum: ["glob", "regex"]
|
|
200
|
-
},
|
|
201
|
-
stage: {
|
|
202
|
-
type: "string",
|
|
203
|
-
enum: ["Request", "Response"]
|
|
204
|
-
},
|
|
205
|
-
responseCode: { type: "number" },
|
|
206
|
-
responseHeaders: {
|
|
207
|
-
type: "object",
|
|
208
|
-
additionalProperties: { type: "string" }
|
|
209
|
-
},
|
|
210
|
-
responseBody: { type: "string" }
|
|
211
|
-
},
|
|
212
|
-
required: ["urlPattern"]
|
|
213
|
-
}, "Batch mode: array of rule objects (action=add)").string("ruleId", "ID of the rule to remove (action=disable)").boolean("all", "Set to true to remove all rules and disable interception (action=disable)", { default: false }).required("action"))
|
|
214
|
-
];
|
|
215
|
-
//#endregion
|
|
216
|
-
export { advancedTools as t };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
|
|
2
|
-
//#region src/server/domains/proxy/definitions.ts
|
|
3
|
-
const PROXY_TOOLS = [
|
|
4
|
-
tool("proxy_start", (t) => t.desc("Start the Mockttp local HTTP/HTTPS proxy server. Generates a local CA if one does not exist for TLS interception.").number("port", "Port to listen on. Defaults to 8080.", { default: 8080 }).boolean("useHttps", "Whether to enable full HTTPS decryption. Defaults to true.", { default: true })),
|
|
5
|
-
tool("proxy_stop", (t) => t.desc("Stop the running Mockttp proxy server.").destructive()),
|
|
6
|
-
tool("proxy_status", (t) => t.desc("Get the current status of the proxy server and the generated CA path.").query()),
|
|
7
|
-
tool("proxy_export_ca", (t) => t.desc("Export the path or raw string of the local CA root certificate so the user can install and trust it on their target test devices.").query()),
|
|
8
|
-
tool("proxy_add_rule", (t) => t.desc("Add a new interception, forwarding, or mocking rule to the proxy.").string("action", "Action to perform when matched (forward, mock_response, block)").string("method", "HTTP method to match (e.g. GET, POST)", { default: "GET" }).string("urlPattern", "URL pattern to match (can be string or regex format like /api/.*)").number("mockStatus", "Status code to return if action is mock_response", { default: 200 }).string("mockBody", "Body to return if action is mock_response").required("action")),
|
|
9
|
-
tool("proxy_get_requests", (t) => t.desc("Retrieve the captured HTTP/HTTPS requests from the proxy buffer. You can filter by URL.").string("urlFilter", "Optional partial URL match filter.").query()),
|
|
10
|
-
tool("proxy_clear_logs", (t) => t.desc("Clear the captured HTTP/HTTPS requests buffer.").resettable()),
|
|
11
|
-
tool("proxy_setup_adb_device", (t) => t.desc("Configure an Android device via ADB to route traffic through this proxy and inject the CA certificate.").string("deviceSerial", "ADB device serial (optional if only one device is connected)."))
|
|
12
|
-
];
|
|
13
|
-
//#endregion
|
|
14
|
-
export { PROXY_TOOLS as t };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
|
|
2
|
-
//#region src/server/domains/coordination/definitions.ts
|
|
3
|
-
const coordinationTools = [
|
|
4
|
-
tool("create_task_handoff", (t) => t.desc("Create a sub-task handoff for specialist agent delegation.").array("constraints", { type: "string" }, "Constraints for the specialist").string("targetDomain", "Suggested domain for the specialist").required("description")),
|
|
5
|
-
tool("complete_task_handoff", (t) => t.desc("Complete a task handoff with results. Transitions status to completed.").string("taskId", "Task ID from create_task_handoff").string("summary", "Concise summary of what was accomplished").array("keyFindings", { type: "string" }, "Key discoveries or results").array("artifacts", { type: "string" }, "Paths to generated artifact files").required("taskId", "summary")),
|
|
6
|
-
tool("get_task_context", (t) => t.desc("Read task handoff context.").query()),
|
|
7
|
-
tool("append_session_insight", (t) => t.desc("Append a discovery to the session-level knowledge accumulator shared across handoffs").enum("category", [
|
|
8
|
-
"auth",
|
|
9
|
-
"crypto",
|
|
10
|
-
"api",
|
|
11
|
-
"anti_debug",
|
|
12
|
-
"architecture",
|
|
13
|
-
"vulnerability",
|
|
14
|
-
"other"
|
|
15
|
-
], "Insight category").string("content", "The insight content").prop("confidence", {
|
|
16
|
-
type: "number",
|
|
17
|
-
description: "Confidence level 0.0-1.0",
|
|
18
|
-
minimum: 0,
|
|
19
|
-
maximum: 1
|
|
20
|
-
}).required("category", "content")),
|
|
21
|
-
tool("save_page_snapshot", (t) => t.desc("Save current page state (URL, cookies, storage) for checkpoint/restore workflows").string("label", "Human-readable label for this snapshot").readOnly()),
|
|
22
|
-
tool("restore_page_snapshot", (t) => t.desc("Restore a saved page snapshot — navigates to URL and reinjects cookies and storage").string("snapshotId", "Snapshot ID from save_page_snapshot").required("snapshotId").idempotent()),
|
|
23
|
-
tool("list_page_snapshots", (t) => t.desc("List all saved page snapshots in the current session").query())
|
|
24
|
-
];
|
|
25
|
-
//#endregion
|
|
26
|
-
export { coordinationTools as t };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
|
|
2
|
-
//#region src/server/domains/wasm/definitions.ts
|
|
3
|
-
const wasmTools = [
|
|
4
|
-
tool("wasm_dump", (t) => t.desc("Dump a WebAssembly module from the current browser page.\n\nExtracts the WASM binary via the webassembly-full hook preset, saves it to disk, and returns module metadata (hash, size, imports, exports).\n\nPrerequisites: A page with WASM must be loaded. The webassembly-full hook preset will be auto-injected if not already active.").number("moduleIndex", "Index of the WASM module to dump if multiple were loaded", { default: 0 }).string("outputPath", "Custom output file path. If omitted, auto-generates in artifacts/wasm/")),
|
|
5
|
-
tool("wasm_disassemble", (t) => t.desc("Disassemble a .wasm file to WebAssembly Text Format (WAT) using wasm2wat.\n\nRequires: wabt toolchain installed (wasm2wat in PATH).\n\nUSE THIS to read WASM bytecode as human-readable text. The output shows all functions, imports, exports, and instructions.").string("inputPath", "Path to the .wasm file to disassemble").string("outputPath", "Output .wat file path. If omitted, auto-generates in artifacts/wasm/").boolean("foldExprs", "Fold expressions for more compact output", { default: true }).required("inputPath")),
|
|
6
|
-
tool("wasm_decompile", (t) => t.desc("Decompile a .wasm file to C-like pseudo-code using wasm-decompile.\n\nRequires: wabt toolchain installed (wasm-decompile in PATH).\n\nProduces more readable output than WAT, resembling C/JavaScript syntax. Useful for understanding VMP handler logic.").string("inputPath", "Path to the .wasm file to decompile").string("outputPath", "Output file path. If omitted, auto-generates in artifacts/wasm/").required("inputPath")),
|
|
7
|
-
tool("wasm_inspect_sections", (t) => t.desc("Inspect sections and metadata of a .wasm file using wasm-objdump.\n\nRequires: wabt toolchain installed (wasm-objdump in PATH).\n\nReturns section headers, import/export tables, function signatures, and memory layout.").string("inputPath", "Path to the .wasm file to inspect").enum("sections", [
|
|
8
|
-
"headers",
|
|
9
|
-
"details",
|
|
10
|
-
"disassemble",
|
|
11
|
-
"all"
|
|
12
|
-
], "What to dump: headers (section overview), details (full metadata), disassemble (bytecode), all", { default: "details" }).required("inputPath")),
|
|
13
|
-
tool("wasm_offline_run", (t) => t.desc("Execute a specific exported function from a .wasm file offline using wasmtime or wasmer.\n\nRequires: wasmtime or wasmer installed in PATH.\n\nUSE THIS to run sign/encrypt functions extracted from WASM VMP without a browser. Provide the function name and arguments.\n\nSecurity: Runs in a sandboxed WASM runtime with no filesystem or network access.").string("inputPath", "Path to the .wasm file").string("functionName", "Name of the exported function to invoke (e.g., \"_sign\", \"encrypt\")").array("args", { type: "string" }, "Arguments to pass to the function (will be parsed as integers/floats)").enum("runtime", [
|
|
14
|
-
"wasmtime",
|
|
15
|
-
"wasmer",
|
|
16
|
-
"auto"
|
|
17
|
-
], "WASM runtime to use. \"auto\" tries wasmtime first, then wasmer", { default: "auto" }).number("timeoutMs", "Execution timeout in ms", { default: 1e4 }).required("inputPath", "functionName")),
|
|
18
|
-
tool("wasm_optimize", (t) => t.desc("Optimize a .wasm file using binaryen wasm-opt.\n\nRequires: binaryen toolchain installed (wasm-opt in PATH).\n\nApplies optimization passes (dead code elimination, constant folding, etc.) to reduce size and improve performance. Optimized output can be re-injected into the browser.").string("inputPath", "Path to the .wasm file to optimize").string("outputPath", "Output optimized .wasm file path. If omitted, auto-generates in artifacts/wasm/").enum("level", [
|
|
19
|
-
"O1",
|
|
20
|
-
"O2",
|
|
21
|
-
"O3",
|
|
22
|
-
"O4",
|
|
23
|
-
"Os",
|
|
24
|
-
"Oz"
|
|
25
|
-
], "Optimization level", { default: "O2" }).required("inputPath")),
|
|
26
|
-
tool("wasm_vmp_trace", (t) => t.desc("Trace WASM VMP (Virtual Machine Protection) opcode execution.\n\nCombines the webassembly-full hook preset with enhanced import call tracing to reconstruct VMP handler tables and execution flows.\n\nUSE THIS when a page uses WASM-based VMP to protect sign/encrypt functions. Returns:\n- Import call sequence (opcode trace)\n- Identified handler patterns\n- Input→output data flow").number("maxEvents", "Maximum import call events to capture", { default: 5e3 }).string("filterModule", "Only trace calls to this import module name (e.g., \"env\", \"wasi_snapshot_preview1\")")),
|
|
27
|
-
tool("wasm_memory_inspect", (t) => t.desc("Inspect WebAssembly.Memory contents from the browser.\n\nReads the linear memory buffer of the active WASM module, displaying it as hex dump, ASCII, or searching for patterns.\n\nUSE THIS to:\n- Examine WASM memory layout (stack, heap, data segments)\n- Find strings, keys, or encoded data in WASM memory\n- Track how input data is transformed through WASM functions").number("offset", "Starting byte offset to read from", { default: 0 }).number("length", "Number of bytes to read", { default: 256 }).enum("format", [
|
|
28
|
-
"hex",
|
|
29
|
-
"ascii",
|
|
30
|
-
"both"
|
|
31
|
-
], "Output format", { default: "both" }).string("searchPattern", "Search for this hex pattern or ASCII string in the memory range"))
|
|
32
|
-
];
|
|
33
|
-
//#endregion
|
|
34
|
-
export { wasmTools as t };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { t as tool } from "./tool-builder-DCbIC5Eo.mjs";
|
|
2
|
-
//#region src/server/domains/sourcemap/definitions.ts
|
|
3
|
-
const sourcemapTools = [
|
|
4
|
-
tool("sourcemap_discover", (t) => t.desc("自动发现页面中的 SourceMap(CDP scriptParsed + 脚本尾部注释回退)").boolean("includeInline", "包含 data: URI 内联 SourceMap", { default: true })),
|
|
5
|
-
tool("sourcemap_fetch_and_parse", (t) => t.desc("获取并解析 SourceMap v3(纯 TypeScript VLQ 解码),还原映射统计").string("sourceMapUrl", "SourceMap URL(绝对/相对/data: URI)").string("scriptUrl", "用于解析相对路径的脚本 URL").required("sourceMapUrl")),
|
|
6
|
-
tool("sourcemap_reconstruct_tree", (t) => t.desc("从 SourceMap 重建原始项目文件树并写出到目录").string("sourceMapUrl", "SourceMap URL").string("outputDir", "输出目录").required("sourceMapUrl"))
|
|
7
|
-
];
|
|
8
|
-
//#endregion
|
|
9
|
-
export { sourcemapTools as t };
|