@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.
- package/README.md +36 -5
- package/README.zh.md +36 -5
- package/dist/{AntiCheatDetector-S8VRj-dD.mjs → AntiCheatDetector-CqGDXmfc.mjs} +160 -54
- package/dist/{CodeInjector-4Z3ngPoX.mjs → CodeInjector-BdjRfNx7.mjs} +5 -5
- package/dist/ConsoleMonitor-DykL3IAw.mjs +2269 -0
- package/dist/{DarwinAPI-B8hg_yhz.mjs → DarwinAPI-ETyy0xyo.mjs} +1 -1
- package/dist/DetailedDataManager-HT49OrvF.mjs +217 -0
- package/dist/EventBus-DFKvADm3.mjs +141 -0
- package/dist/EvidenceGraphBridge-318Oi0Lf.mjs +153 -0
- package/dist/{ExtensionManager-D5-bO9D8.mjs → ExtensionManager-BDMsY2Dz.mjs} +27 -13
- package/dist/{FingerprintManager-BVxFJL2-.mjs → FingerprintManager-BN4UQWnX.mjs} +1 -1
- package/dist/{HardwareBreakpoint-DK1yjWkV.mjs → HardwareBreakpoint-Cc2AFq1Y.mjs} +3 -3
- package/dist/{HeapAnalyzer-CEbo10xU.mjs → HeapAnalyzer-DruMgsgj.mjs} +21 -21
- package/dist/HookGeneratorBuilders.core.generators.storage-CTbB4Lcx.mjs +566 -0
- package/dist/InstrumentationSession-DLH0vd-z.mjs +244 -0
- package/dist/{MemoryController-DdtnBdD4.mjs → MemoryController-CMtviNW_.mjs} +3 -3
- package/dist/{MemoryScanSession-RMixN3bX.mjs → MemoryScanSession-ITgb_NMi.mjs} +81 -78
- package/dist/{MemoryScanner-QjK4ld0B.mjs → MemoryScanner-CiL7Z3ey.mjs} +50 -21
- package/dist/{NativeMemoryManager.impl-CB6gJ0NM.mjs → NativeMemoryManager.impl-D9Lkovvn.mjs} +20 -56
- package/dist/{NativeMemoryManager.utils-BML4q1ry.mjs → NativeMemoryManager.utils-BBlAixF5.mjs} +1 -1
- package/dist/{PEAnalyzer-CK0xe0Fs.mjs → PEAnalyzer-DMQ44gen.mjs} +16 -16
- package/dist/PageController-BPJNqqBN.mjs +431 -0
- package/dist/{PointerChainEngine-Cd73qu5b.mjs → PointerChainEngine-K7wN8Z-w.mjs} +10 -7
- package/dist/PrerequisiteError-TuyZIs6n.mjs +20 -0
- package/dist/ProcessRegistry-zGg12QbE.mjs +74 -0
- package/dist/ResponseBuilder-CJXWmWNw.mjs +143 -0
- package/dist/ReverseEvidenceGraph-C02-gXOh.mjs +269 -0
- package/dist/ScriptManager-ZuWD-0Jg.mjs +3003 -0
- package/dist/{Speedhack-CeF0XmEz.mjs → Speedhack-D-z0umeT.mjs} +2 -2
- package/dist/{StructureAnalyzer-D4GkMduU.mjs → StructureAnalyzer-Cav5AVSL.mjs} +9 -6
- package/dist/ToolCatalog-5OJdMiF0.mjs +582 -0
- package/dist/ToolError-jh9whhMd.mjs +15 -0
- package/dist/ToolProbe-DbCFGyrg.mjs +45 -0
- package/dist/ToolRegistry-B9krbTtI.mjs +180 -0
- package/dist/ToolRouter.policy-BGDAGyeH.mjs +344 -0
- package/dist/TraceRecorder-B41Z5XBj.mjs +1286 -0
- package/dist/{Win32API-Bc0QnQsN.mjs → Win32API-C2kjj0ze.mjs} +19 -13
- package/dist/{Win32Debug-DUHt9XUn.mjs → Win32Debug-CKrGOTpo.mjs} +3 -3
- package/dist/WorkflowEngine-DJ6M4opp.mjs +569 -0
- package/dist/analysis-BHeJW2Nb.mjs +1234 -0
- package/dist/antidebug-BRKeyt27.mjs +1081 -0
- package/dist/artifactRetention-CPXkUJXp.mjs +598 -0
- package/dist/artifacts-DkfosXH3.mjs +59 -0
- package/dist/authorization-schema-DRqyJMSk.mjs +31 -0
- package/dist/betterSqlite3-DLSBZodi.mjs +74 -0
- package/dist/binary-instrument--V3MAhJ4.mjs +971 -0
- package/dist/bind-helpers-ClV34xdn.mjs +42 -0
- package/dist/boringssl-inspector-Bo_LOLaS.mjs +180 -0
- package/dist/browser-Dx3_S2cG.mjs +4369 -0
- package/dist/capabilities-CcHlvWgK.mjs +33 -0
- package/dist/concurrency-Drev_Vz9.mjs +41 -0
- package/dist/{constants-CCvsN80K.mjs → constants-CDZLOoVv.mjs} +105 -48
- package/dist/coordination-DgItD9DL.mjs +259 -0
- package/dist/debugger-RS3RSAqs.mjs +1288 -0
- package/dist/definitions-BEoYofW5.mjs +47 -0
- package/dist/definitions-BRaefg3u.mjs +365 -0
- package/dist/definitions-BbkvZkiv.mjs +96 -0
- package/dist/definitions-BtWSHJ3o.mjs +17 -0
- package/dist/definitions-C1gCHO0i.mjs +43 -0
- package/dist/definitions-CDOg_b-l.mjs +138 -0
- package/dist/definitions-CVPD9hzZ.mjs +54 -0
- package/dist/definitions-Cea8Lgl7.mjs +94 -0
- package/dist/definitions-DAgIyjxM.mjs +10 -0
- package/dist/definitions-DJA27nsL.mjs +66 -0
- package/dist/definitions-DKPFU3LW.mjs +25 -0
- package/dist/definitions-DPRpZQ96.mjs +47 -0
- package/dist/definitions-DUE5gmdn.mjs +18 -0
- package/dist/definitions-DYVjOtxa.mjs +26 -0
- package/dist/definitions-DcYLVLCo.mjs +37 -0
- package/dist/definitions-Pp5LI2H4.mjs +27 -0
- package/dist/definitions-j9KdHVNR.mjs +14 -0
- package/dist/definitions-uzkjBwa7.mjs +258 -0
- package/dist/definitions-va-AnLuQ.mjs +28 -0
- package/dist/encoding-DJeqHmpd.mjs +1079 -0
- package/dist/evidence-graph-bridge-DcYizFk2.mjs +136 -0
- package/dist/{factory-CibqTNC8.mjs → factory-C90tBff6.mjs} +41 -56
- package/dist/flat-target-session-Dgax2Cy3.mjs +29 -0
- package/dist/graphql-CoHrhweh.mjs +1197 -0
- package/dist/handlers-4jmR0nMs.mjs +898 -0
- package/dist/handlers-BAHPxcch.mjs +789 -0
- package/dist/handlers-BOs9b907.mjs +2600 -0
- package/dist/handlers-BWXEy6ef.mjs +917 -0
- package/dist/handlers-Bndn6QvE.mjs +111 -0
- package/dist/handlers-BqC4bD4s.mjs +681 -0
- package/dist/handlers-BtYq60bM2.mjs +276 -0
- package/dist/handlers-BzgcB4iv.mjs +799 -0
- package/dist/handlers-CRyRWj2b.mjs +859 -0
- package/dist/handlers-CVv2H1uq.mjs +592 -0
- package/dist/handlers-Dl5a7JS4.mjs +572 -0
- package/dist/handlers-Dx2d7jt7.mjs +2537 -0
- package/dist/handlers-Dz9PYsCa.mjs +2805 -0
- package/dist/handlers-HujRKC3b.mjs +661 -0
- package/dist/handlers.impl-XWXkQfyi.mjs +807 -0
- package/dist/hooks-B1B8NRHL.mjs +898 -0
- package/dist/index.mjs +491 -259
- package/dist/{logger-BmWzC2lM.mjs → logger-Dh_xb7_2.mjs} +14 -6
- package/dist/maintenance-PRMkLVRW.mjs +835 -0
- package/dist/manifest-67Bok-Si.mjs +58 -0
- package/dist/manifest-6lNTMZAB2.mjs +87 -0
- package/dist/manifest-B2duEHiH.mjs +90 -0
- package/dist/manifest-B6EY9Vm8.mjs +57 -0
- package/dist/manifest-B6nKSbyY.mjs +95 -0
- package/dist/manifest-BL8AQNPF.mjs +106 -0
- package/dist/manifest-BSZvJJmV.mjs +47 -0
- package/dist/manifest-BU7qzUyX.mjs +418 -0
- package/dist/manifest-Bl62e8WK.mjs +49 -0
- 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-C-xtsjS3.mjs +81 -0
- package/dist/manifest-CDYl7OhA.mjs +66 -0
- 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-D7YZM_2e.mjs +194 -0
- package/dist/manifest-DE_VrAeQ.mjs +314 -0
- package/dist/manifest-DGsXSCpT.mjs +39 -0
- package/dist/manifest-DJ2vfEuW.mjs +156 -0
- package/dist/manifest-DPXDYhEu.mjs +80 -0
- package/dist/manifest-Dd4fQb0a.mjs +322 -0
- package/dist/manifest-Deq6opGg.mjs +223 -0
- package/dist/manifest-DfJTafJK.mjs +37 -0
- package/dist/manifest-DgOdgN_j.mjs +50 -0
- package/dist/manifest-DlbMW4v4.mjs +47 -0
- package/dist/manifest-DmVfbH0w.mjs +374 -0
- 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-cEJU1v0Z.mjs +129 -0
- package/dist/manifest-wOl5XLB12.mjs +112 -0
- package/dist/modules-tZozf0LQ.mjs +10635 -0
- package/dist/mojo-ipc-DXNEXEqb.mjs +640 -0
- package/dist/network-CPVvwvFg.mjs +3852 -0
- package/dist/{artifacts-BbdOMET5.mjs → outputPaths-um7lCRY3.mjs} +219 -216
- package/dist/parse-args-B4cY5Vx5.mjs +39 -0
- package/dist/platform-CYeFoTWp.mjs +2161 -0
- package/dist/process-BTbgcVc6.mjs +1306 -0
- package/dist/proxy-r8YN6nP1.mjs +192 -0
- package/dist/registry-Bl8ZQW61.mjs +34 -0
- package/dist/response-CWhh2aLo.mjs +34 -0
- package/dist/server/plugin-api.mjs +2 -2
- package/dist/shared-state-board-BoZnSoj-.mjs +586 -0
- package/dist/sourcemap-BIDHUVXy.mjs +934 -0
- package/dist/ssrf-policy-Dsqd-DTX.mjs +166 -0
- package/dist/streaming-Dal6utPp.mjs +725 -0
- package/dist/tool-builder-BHJp32mV.mjs +186 -0
- package/dist/transform-DRVgGG90.mjs +1011 -0
- package/dist/types-Bx92KJfT.mjs +4 -0
- package/dist/wasm-BYx5UOeG.mjs +1044 -0
- package/dist/webcrack-Be0_FccV.mjs +747 -0
- package/dist/workflow-BpuKEtvn.mjs +725 -0
- package/package.json +82 -49
- package/dist/ExtensionManager-CPTJhHFg.mjs +0 -2
- package/dist/ToolCatalog-Bq4V2sbJ.mjs +0 -67201
- package/dist/{CacheAdapters-CzFNpD9a.mjs → CacheAdapters-jJFy20G-.mjs} +0 -0
- package/dist/{StealthVerifier-BzBCFiwx.mjs → StealthVerifier-BWmPgQsv.mjs} +0 -0
- package/dist/{VersionDetector-CNXcvD46.mjs → VersionDetector-K3V4vGsw.mjs} +0 -0
- package/dist/{formatAddress-ChCSIRWT.mjs → formatAddress-nnMvEohD.mjs} +0 -0
- package/dist/{types-BBjOqye-.mjs → types-DDBWs9UP.mjs} +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { t as tool } from "./tool-builder-BHJp32mV.mjs";
|
|
2
|
+
//#region src/server/domains/wasm/definitions.ts
|
|
3
|
+
const wasmTools = [
|
|
4
|
+
tool("wasm_capabilities", (t) => t.desc("Report WASM tool availability.").query()),
|
|
5
|
+
tool("wasm_dump", (t) => t.desc("Dump a captured WebAssembly module from the current page.").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/")),
|
|
6
|
+
tool("wasm_disassemble", (t) => t.desc("Disassemble a .wasm file to WAT.").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")),
|
|
7
|
+
tool("wasm_decompile", (t) => t.desc("Decompile a .wasm file to pseudo-code.").string("inputPath", "Path to the .wasm file to decompile").string("outputPath", "Output file path. If omitted, auto-generates in artifacts/wasm/").required("inputPath")),
|
|
8
|
+
tool("wasm_inspect_sections", (t) => t.desc("Inspect sections and metadata of a .wasm file.").string("inputPath", "Path to the .wasm file to inspect").enum("sections", [
|
|
9
|
+
"headers",
|
|
10
|
+
"details",
|
|
11
|
+
"disassemble",
|
|
12
|
+
"all"
|
|
13
|
+
], "What to dump: headers (section overview), details (full metadata), disassemble (bytecode), all", { default: "details" }).required("inputPath")),
|
|
14
|
+
tool("wasm_offline_run", (t) => t.desc("Run an exported .wasm function.").string("inputPath", "Path to the .wasm file").string("functionName", "Name of the exported function to invoke").array("args", { type: "string" }, "Arguments to pass to the function (will be parsed as integers/floats)").enum("runtime", [
|
|
15
|
+
"wasmtime",
|
|
16
|
+
"wasmer",
|
|
17
|
+
"auto"
|
|
18
|
+
], "WASM runtime to use. \"auto\" tries wasmtime first, then wasmer", { default: "auto" }).number("timeoutMs", "Execution timeout in ms", { default: 1e4 }).required("inputPath", "functionName")),
|
|
19
|
+
tool("wasm_optimize", (t) => t.desc("Optimize a .wasm file.").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", [
|
|
20
|
+
"O1",
|
|
21
|
+
"O2",
|
|
22
|
+
"O3",
|
|
23
|
+
"O4",
|
|
24
|
+
"Os",
|
|
25
|
+
"Oz"
|
|
26
|
+
], "Optimization level", { default: "O2" }).required("inputPath")),
|
|
27
|
+
tool("wasm_vmp_trace", (t) => t.desc("Read captured WASM VMP import-call traces from the current page.").number("maxEvents", "Maximum import call events to capture", { default: 5e3 }).string("filterModule", "Filter by import module name")),
|
|
28
|
+
tool("wasm_memory_inspect", (t) => t.desc("Inspect exported WebAssembly.Memory from the current page.").number("offset", "Starting byte offset to read from", { default: 0 }).number("length", "Number of bytes to read", { default: 256 }).enum("format", [
|
|
29
|
+
"hex",
|
|
30
|
+
"ascii",
|
|
31
|
+
"both"
|
|
32
|
+
], "Output format", { default: "both" }).string("searchPattern", "Search for this hex pattern or ASCII string in the memory range")),
|
|
33
|
+
tool("wasm_to_c", (t) => t.desc("Convert a .wasm file to C source and header.").string("inputPath", "Path to the .wasm file to convert").string("outputDir", "Directory for generated .c and .h files. If omitted, uses artifacts/wasm/").required("inputPath")),
|
|
34
|
+
tool("wasm_detect_obfuscation", (t) => t.desc("Detect obfuscation patterns in a .wasm file.").string("inputPath", "Path to the .wasm file to analyze").boolean("verbose", "Include detailed pattern evidence in output", { default: false }).required("inputPath")),
|
|
35
|
+
tool("wasm_instrument_trace", (t) => t.desc("Generate a JS instrumentation wrapper for a .wasm module.").string("inputPath", "Path to the .wasm file to instrument").array("hooks", {
|
|
36
|
+
type: "string",
|
|
37
|
+
enum: [
|
|
38
|
+
"call",
|
|
39
|
+
"memory",
|
|
40
|
+
"branch",
|
|
41
|
+
"loop",
|
|
42
|
+
"local"
|
|
43
|
+
]
|
|
44
|
+
}, "Hook types to inject").boolean("allHooks", "Inject all available hook types", { default: true }).string("outputPath", "Output JS file path. If omitted, auto-generates in artifacts/wasm/").required("inputPath"))
|
|
45
|
+
];
|
|
46
|
+
//#endregion
|
|
47
|
+
export { wasmTools as t };
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { t as tool } from "./tool-builder-BHJp32mV.mjs";
|
|
2
|
+
//#region src/server/domains/browser/definitions.tools.advanced.ts
|
|
3
|
+
const advancedBrowserToolDefinitions = [tool("js_heap_search", (t) => t.desc("Search JS heap for strings matching a pattern.").string("pattern", "Pattern to search").number("maxResults", "Max matches", { default: 50 }).boolean("caseSensitive", "Case sensitive", { default: false }).required("pattern").query()), tool("tab_workflow", (t) => t.desc("Cross-tab coordination.").enum("action", [
|
|
4
|
+
"list",
|
|
5
|
+
"alias_bind",
|
|
6
|
+
"alias_open",
|
|
7
|
+
"navigate",
|
|
8
|
+
"wait_for",
|
|
9
|
+
"context_set",
|
|
10
|
+
"context_get",
|
|
11
|
+
"transfer",
|
|
12
|
+
"clear"
|
|
13
|
+
], "Action").string("alias", "Tab alias").string("fromAlias", "Source tab alias").number("index", "Tab index (0-based)").string("url", "URL").string("selector", "CSS selector to wait for").string("waitForText", "Text to wait for").string("key", "Context key").string("value", "Context value").string("expression", "JS expression for transfer").number("timeoutMs", "Timeout ms", { default: 1e4 }).requiredOpenWorld("action"))];
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/server/domains/browser/definitions.tools.page-core.ts
|
|
16
|
+
const browserPageCoreTools = [
|
|
17
|
+
tool("page_navigate", (t) => t.desc("Navigate to a URL.").string("url", "Target URL").enum("waitUntil", [
|
|
18
|
+
"load",
|
|
19
|
+
"domcontentloaded",
|
|
20
|
+
"networkidle",
|
|
21
|
+
"commit"
|
|
22
|
+
], "When to consider navigation succeeded", { default: "networkidle" }).number("timeout", "Navigation timeout in ms", {
|
|
23
|
+
default: 3e4,
|
|
24
|
+
minimum: 1e3,
|
|
25
|
+
maximum: 12e4
|
|
26
|
+
}).boolean("enableNetworkMonitoring", "Enable network monitoring before navigation", { default: false }).required("url").idempotent().openWorld()),
|
|
27
|
+
tool("page_reload", (t) => t.desc("Reload current page").idempotent().openWorld()),
|
|
28
|
+
tool("page_back", (t) => t.desc("Go back in history").openWorld()),
|
|
29
|
+
tool("page_forward", (t) => t.desc("Go forward in history").openWorld()),
|
|
30
|
+
tool("page_click", (t) => t.desc("Click an element.").string("selector", "CSS selector").enum("button", [
|
|
31
|
+
"left",
|
|
32
|
+
"right",
|
|
33
|
+
"middle"
|
|
34
|
+
], "Mouse button", { default: "left" }).number("clickCount", "Number of clicks", {
|
|
35
|
+
default: 1,
|
|
36
|
+
minimum: 1,
|
|
37
|
+
maximum: 10
|
|
38
|
+
}).number("delay", "Delay between mousedown and mouseup in ms", {
|
|
39
|
+
minimum: 0,
|
|
40
|
+
maximum: 1e4
|
|
41
|
+
}).number("timeout", "Click timeout in ms", {
|
|
42
|
+
default: 1e4,
|
|
43
|
+
minimum: 1e3,
|
|
44
|
+
maximum: 12e4
|
|
45
|
+
}).string("frameUrl", "iframe URL substring").string("frameSelector", "iframe CSS selector").requiredOpenWorld("selector")),
|
|
46
|
+
tool("page_type", (t) => t.desc("Type text into an element.").string("selector", "CSS selector").string("text", "Text to type").number("delay", "Delay between key presses in ms", {
|
|
47
|
+
minimum: 0,
|
|
48
|
+
maximum: 1e3
|
|
49
|
+
}).string("frameUrl", "iframe URL substring").string("frameSelector", "iframe CSS selector").requiredOpenWorld("selector", "text")),
|
|
50
|
+
tool("page_select", (t) => t.desc("Select option(s) in a <select> element.").string("selector", "CSS selector").array("values", { type: "string" }, "Values to select").string("frameUrl", "iframe URL substring").string("frameSelector", "iframe CSS selector").required("selector", "values").idempotent().openWorld()),
|
|
51
|
+
tool("page_hover", (t) => t.desc("Hover over an element.").string("selector", "CSS selector").string("frameUrl", "iframe URL substring").string("frameSelector", "iframe CSS selector").required("selector").idempotent().openWorld()),
|
|
52
|
+
tool("page_scroll", (t) => t.desc("Scroll the page.").number("x", "Horizontal position", { default: 0 }).number("y", "Vertical position", { default: 0 }).idempotent()),
|
|
53
|
+
tool("page_wait_for_selector", (t) => t.desc("Wait for an element to appear.").string("selector", "CSS selector").number("timeout", "Timeout in ms", {
|
|
54
|
+
default: 3e4,
|
|
55
|
+
minimum: 1e3,
|
|
56
|
+
maximum: 12e4
|
|
57
|
+
}).required("selector").query()),
|
|
58
|
+
tool("page_evaluate", (t) => t.desc("Execute JavaScript in page context.").string("code", "JavaScript code").boolean("autoSummarize", "Auto-summarize large results", { default: true }).number("maxSize", "Max result size in bytes before summarizing", {
|
|
59
|
+
default: 51200,
|
|
60
|
+
minimum: 1024,
|
|
61
|
+
maximum: 10485760
|
|
62
|
+
}).array("fieldFilter", { type: "string" }, "Field names to strip from result (recursive)").boolean("stripBase64", "Strip base64 strings from result", { default: false }).string("frameUrl", "iframe URL substring").string("frameSelector", "iframe CSS selector").requiredOpenWorld("code")),
|
|
63
|
+
tool("page_screenshot", (t) => t.desc("Take a screenshot.").prop("selector", {
|
|
64
|
+
oneOf: [{
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "CSS selector"
|
|
67
|
+
}, {
|
|
68
|
+
type: "array",
|
|
69
|
+
items: { type: "string" },
|
|
70
|
+
description: "Multiple CSS selectors"
|
|
71
|
+
}],
|
|
72
|
+
description: "Element selector(s). Omit for full page viewport."
|
|
73
|
+
}).object("clip", {
|
|
74
|
+
x: {
|
|
75
|
+
type: "number",
|
|
76
|
+
description: "Left offset"
|
|
77
|
+
},
|
|
78
|
+
y: {
|
|
79
|
+
type: "number",
|
|
80
|
+
description: "Top offset"
|
|
81
|
+
},
|
|
82
|
+
width: {
|
|
83
|
+
type: "number",
|
|
84
|
+
description: "Width"
|
|
85
|
+
},
|
|
86
|
+
height: {
|
|
87
|
+
type: "number",
|
|
88
|
+
description: "Height"
|
|
89
|
+
}
|
|
90
|
+
}, "Pixel region to capture", { required: [
|
|
91
|
+
"x",
|
|
92
|
+
"y",
|
|
93
|
+
"width",
|
|
94
|
+
"height"
|
|
95
|
+
] }).string("path", "File path to save screenshot").enum("type", ["png", "jpeg"], "Image format", { default: "png" }).number("quality", "Image quality 0-100 (jpeg only)", {
|
|
96
|
+
minimum: 1,
|
|
97
|
+
maximum: 100
|
|
98
|
+
}).boolean("fullPage", "Capture full scrollable page", { default: false }).query()),
|
|
99
|
+
tool("get_all_scripts", (t) => t.desc("List all loaded scripts.").boolean("includeSource", "Include source code", { default: false }).query()),
|
|
100
|
+
tool("get_script_source", (t) => t.desc("Get source code of a script.").string("scriptId", "Script ID").string("url", "Script URL (supports wildcards)").boolean("preview", "Preview only (first N lines + metadata)", { default: false }).number("maxLines", "Max lines in preview", {
|
|
101
|
+
default: 100,
|
|
102
|
+
minimum: 1,
|
|
103
|
+
maximum: 1e4
|
|
104
|
+
}).number("startLine", "Start line (1-based)", { minimum: 1 }).number("endLine", "End line (1-based)", { minimum: 1 }).query())
|
|
105
|
+
];
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/server/domains/browser/definitions.tools.page-system.ts
|
|
108
|
+
const browserPageSystemTools = [
|
|
109
|
+
tool("console_monitor", (t) => t.desc("Enable or disable console monitoring.").enum("action", ["enable", "disable"], "Action").required("action").idempotent()),
|
|
110
|
+
tool("console_get_logs", (t) => t.desc("Get captured console logs.").enum("type", [
|
|
111
|
+
"log",
|
|
112
|
+
"warn",
|
|
113
|
+
"error",
|
|
114
|
+
"info",
|
|
115
|
+
"debug"
|
|
116
|
+
], "Log type filter").number("limit", "Max logs").number("since", "Timestamp filter").query()),
|
|
117
|
+
tool("console_execute", (t) => t.desc("Execute JS in console context.").string("expression", "JavaScript expression").requiredOpenWorld("expression")),
|
|
118
|
+
tool("page_inject_script", (t) => t.desc("Inject JS into the page.").string("script", "JavaScript code").requiredOpenWorld("script")),
|
|
119
|
+
tool("page_cookies", (t) => t.desc("Manage page cookies. Clear requires expectedCount (call get first).").enum("action", [
|
|
120
|
+
"get",
|
|
121
|
+
"set",
|
|
122
|
+
"clear"
|
|
123
|
+
], "Action").number("expectedCount", "Required for clear: must match current count").array("cookies", {
|
|
124
|
+
type: "object",
|
|
125
|
+
properties: {
|
|
126
|
+
name: { type: "string" },
|
|
127
|
+
value: { type: "string" },
|
|
128
|
+
domain: { type: "string" },
|
|
129
|
+
path: { type: "string" },
|
|
130
|
+
expires: { type: "number" },
|
|
131
|
+
httpOnly: { type: "boolean" },
|
|
132
|
+
secure: { type: "boolean" },
|
|
133
|
+
sameSite: {
|
|
134
|
+
type: "string",
|
|
135
|
+
enum: [
|
|
136
|
+
"Strict",
|
|
137
|
+
"Lax",
|
|
138
|
+
"None"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
required: ["name", "value"]
|
|
143
|
+
}, "Cookies (action=set)").destructive().required("action")),
|
|
144
|
+
tool("page_set_viewport", (t) => t.desc("Set viewport size.").number("width", "Width").number("height", "Height").required("width", "height").idempotent()),
|
|
145
|
+
tool("page_emulate_device", (t) => t.desc("Emulate a mobile device.").string("device", "Device name").required("device").idempotent()),
|
|
146
|
+
tool("page_local_storage", (t) => t.desc("Manage localStorage.").enum("action", ["get", "set"], "Action").string("key", "Key").string("value", "Value").required("action")),
|
|
147
|
+
tool("page_press_key", (t) => t.desc("Press a keyboard key.").string("key", "Key name").requiredOpenWorld("key"))
|
|
148
|
+
];
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/server/domains/browser/definitions.tools.runtime.ts
|
|
151
|
+
const browserRuntimeTools = [
|
|
152
|
+
tool("get_detailed_data", (t) => t.desc("Retrieve large data by detailId.").string("detailId", "Detail ID from previous response").string("path", "Path to specific nested data").required("detailId").query()),
|
|
153
|
+
tool("browser_launch", (t) => t.desc("Launch or connect to a browser.").enum("driver", ["chrome", "camoufox"], "Browser driver", { default: "chrome" }).boolean("headless", "Run headless", { default: false }).enum("os", [
|
|
154
|
+
"windows",
|
|
155
|
+
"macos",
|
|
156
|
+
"linux"
|
|
157
|
+
], "OS fingerprint (camoufox)", { default: "windows" }).enum("mode", ["launch", "connect"], "Launch or connect", { default: "launch" }).string("browserURL", "Browser debug endpoint URL").string("wsEndpoint", "WebSocket endpoint").boolean("autoConnect", "Auto-detect local Chrome debug WebSocket", { default: false }).enum("channel", [
|
|
158
|
+
"stable",
|
|
159
|
+
"beta",
|
|
160
|
+
"dev",
|
|
161
|
+
"canary"
|
|
162
|
+
], "Chrome channel", { default: "stable" }).string("userDataDir", "Chrome profile directory").array("args", { type: "string" }, "Extra Chrome launch args").boolean("enableV8NativesSyntax", "Enable V8 native syntax for launched Chrome", { default: true }).boolean("geoip", "Auto-resolve GeoIP (camoufox)", { default: false }).boolean("humanize", "Humanize cursor (camoufox)", { default: false }).string("proxy", "Proxy URL (camoufox)").boolean("blockImages", "Block images (camoufox)", { default: false }).boolean("blockWebrtc", "Block WebRTC (camoufox)", { default: false }).boolean("blockWebgl", "Block WebGL (camoufox)", { default: false }).string("locale", "Firefox locale (camoufox)").array("addons", { type: "string" }, "Firefox addons (camoufox)").array("fonts", { type: "string" }, "Custom fonts (camoufox)").array("excludeAddons", { type: "string" }, "Addons to exclude (camoufox)").boolean("customFontsOnly", "Only use custom fonts (camoufox)", { default: false }).object("screen", {
|
|
163
|
+
width: { type: "number" },
|
|
164
|
+
height: { type: "number" }
|
|
165
|
+
}, "Screen resolution (camoufox)").object("window", {
|
|
166
|
+
width: { type: "number" },
|
|
167
|
+
height: { type: "number" }
|
|
168
|
+
}, "Window size (camoufox)").prop("fingerprint", {
|
|
169
|
+
type: "object",
|
|
170
|
+
description: "Pre-generated fingerprint (camoufox)",
|
|
171
|
+
additionalProperties: true
|
|
172
|
+
}).prop("webglConfig", {
|
|
173
|
+
type: "object",
|
|
174
|
+
description: "WebGL config (camoufox)",
|
|
175
|
+
additionalProperties: true
|
|
176
|
+
}).prop("firefoxUserPrefs", {
|
|
177
|
+
type: "object",
|
|
178
|
+
description: "Firefox about:config overrides (camoufox)",
|
|
179
|
+
additionalProperties: true
|
|
180
|
+
}).boolean("mainWorldEval", "Main world eval (camoufox)", { default: false }).boolean("enableCache", "Enable cache (camoufox)", { default: false }).openWorld()),
|
|
181
|
+
tool("camoufox_server", (t) => t.desc("Manage Camoufox WebSocket server.").enum("action", [
|
|
182
|
+
"launch",
|
|
183
|
+
"close",
|
|
184
|
+
"status"
|
|
185
|
+
], "Action").number("port", "Listen port (launch)").string("ws_path", "WebSocket path (launch)").enum("os", [
|
|
186
|
+
"windows",
|
|
187
|
+
"macos",
|
|
188
|
+
"linux"
|
|
189
|
+
], "OS fingerprint (launch)", { default: "windows" }).boolean("headless", "Headless (launch)", { default: true }).boolean("geoip", "GeoIP (launch)", { default: false }).boolean("humanize", "Humanize cursor (launch)", { default: false }).string("proxy", "Proxy URL (launch)").boolean("blockImages", "Block images (launch)", { default: false }).boolean("blockWebrtc", "Block WebRTC (launch)", { default: false }).boolean("blockWebgl", "Block WebGL (launch)", { default: false }).string("locale", "Firefox locale (launch)").array("addons", { type: "string" }, "Addons (launch)").array("fonts", { type: "string" }, "Fonts (launch)").array("excludeAddons", { type: "string" }, "Excluded addons (launch)").boolean("customFontsOnly", "Only custom fonts (launch)", { default: false }).object("screen", {
|
|
190
|
+
width: { type: "number" },
|
|
191
|
+
height: { type: "number" }
|
|
192
|
+
}, "Screen resolution (launch)").object("window", {
|
|
193
|
+
width: { type: "number" },
|
|
194
|
+
height: { type: "number" }
|
|
195
|
+
}, "Window size (launch)").prop("fingerprint", {
|
|
196
|
+
type: "object",
|
|
197
|
+
description: "Pre-generated fingerprint (launch)",
|
|
198
|
+
additionalProperties: true
|
|
199
|
+
}).prop("webglConfig", {
|
|
200
|
+
type: "object",
|
|
201
|
+
description: "WebGL config (launch)",
|
|
202
|
+
additionalProperties: true
|
|
203
|
+
}).prop("firefoxUserPrefs", {
|
|
204
|
+
type: "object",
|
|
205
|
+
description: "Firefox about:config overrides (launch)",
|
|
206
|
+
additionalProperties: true
|
|
207
|
+
}).boolean("mainWorldEval", "Main world eval (launch)", { default: false }).boolean("enableCache", "Enable cache (launch)", { default: false }).required("action").destructive()),
|
|
208
|
+
tool("browser_attach", (t) => t.desc("Attach to a running browser via CDP.").string("browserURL", "Debug endpoint URL").string("wsEndpoint", "WebSocket URL").boolean("autoConnect", "Auto-detect local Chrome debug WebSocket", { default: false }).enum("channel", [
|
|
209
|
+
"stable",
|
|
210
|
+
"beta",
|
|
211
|
+
"dev",
|
|
212
|
+
"canary"
|
|
213
|
+
], "Chrome channel", { default: "stable" }).string("userDataDir", "Chrome profile directory").number("pageIndex", "Tab index to activate", { default: 0 }).openWorld()),
|
|
214
|
+
tool("browser_list_cdp_targets", (t) => t.desc("List CDP targets.").string("browserURL", "Browser URL").string("wsEndpoint", "WebSocket endpoint").boolean("autoConnect", "Auto-detect local Chrome debug WebSocket", { default: false }).enum("channel", [
|
|
215
|
+
"stable",
|
|
216
|
+
"beta",
|
|
217
|
+
"dev",
|
|
218
|
+
"canary"
|
|
219
|
+
], "Chrome channel", { default: "stable" }).string("userDataDir", "Chrome profile directory").string("type", "Target type filter").array("types", { type: "string" }, "Target types to include").string("targetId", "Exact targetId filter").string("urlPattern", "URL substring filter").string("titlePattern", "Title substring filter").boolean("attachedOnly", "Only attached targets", { default: false }).boolean("discoverOOPIF", "Auto-discover cross-origin iframes", { default: true }).query().openWorld()),
|
|
220
|
+
tool("browser_attach_cdp_target", (t) => t.desc("Attach to a CDP target by targetId.").string("targetId", "Target ID").required("targetId")),
|
|
221
|
+
tool("browser_detach_cdp_target", (t) => t.desc("Detach the current CDP target session.").destructive()),
|
|
222
|
+
tool("browser_evaluate_cdp_target", (t) => t.desc("Evaluate JS in the attached CDP target.").string("code", "JavaScript code").string("script", "Alias of code").boolean("returnByValue", "Return by value", { default: true }).boolean("awaitPromise", "Await promises", { default: true }).boolean("autoSummarize", "Summarize large results", { default: true }).number("maxSize", "Max size before summarizing", { default: 51200 }).array("fieldFilter", { type: "string" }, "Field names to strip").boolean("stripBase64", "Strip base64 payloads", { default: false }).required("code")),
|
|
223
|
+
tool("browser_close", (t) => t.desc("Close browser.").destructive()),
|
|
224
|
+
tool("browser_status", (t) => t.desc("Browser status.").query())
|
|
225
|
+
];
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/server/domains/browser/definitions.tools.security.ts
|
|
228
|
+
const browserSecurityStateTools = [
|
|
229
|
+
tool("captcha_detect", (t) => t.desc("Detect CAPTCHA on the page.").query()),
|
|
230
|
+
tool("captcha_wait", (t) => t.desc("Wait for manual CAPTCHA solve.").number("timeout", "Timeout in ms", { default: 3e5 }).query().openWorld()),
|
|
231
|
+
tool("captcha_config", (t) => t.desc("Configure CAPTCHA detection and auto-handling.").boolean("autoDetectCaptcha", "Auto-detect after navigation").boolean("autoSwitchHeadless", "Switch to headed on detection").number("captchaTimeout", "Wait timeout in ms").idempotent()),
|
|
232
|
+
tool("stealth_inject", (t) => t.desc("Inject stealth scripts.").idempotent()),
|
|
233
|
+
tool("stealth_set_user_agent", (t) => t.desc("Set User-Agent and fingerprint.").enum("platform", [
|
|
234
|
+
"windows",
|
|
235
|
+
"mac",
|
|
236
|
+
"linux"
|
|
237
|
+
], "Platform", { default: "windows" }).idempotent()),
|
|
238
|
+
tool("stealth_configure_jitter", (t) => t.desc("Configure CDP timing jitter.").boolean("enabled", "Enable", { default: true }).number("minDelayMs", "Min delay ms", { default: 20 }).number("maxDelayMs", "Max delay ms", { default: 80 }).boolean("burstMode", "Skip jitter for time-critical ops", { default: false }).idempotent()),
|
|
239
|
+
tool("stealth_generate_fingerprint", (t) => t.desc("Generate a browser fingerprint.").enum("os", [
|
|
240
|
+
"windows",
|
|
241
|
+
"macos",
|
|
242
|
+
"linux"
|
|
243
|
+
], "Target OS").enum("browser", ["chrome", "firefox"], "Target browser", { default: "chrome" }).string("locale", "Locale", { default: "en-US" })),
|
|
244
|
+
tool("stealth_verify", (t) => t.desc("Run anti-detection checks.").query()),
|
|
245
|
+
tool("browser_list_tabs", (t) => t.desc("List open tabs.").string("browserURL", "Browser URL").string("wsEndpoint", "WebSocket endpoint").boolean("autoConnect", "Auto-detect Chrome debug WebSocket", { default: false }).enum("channel", [
|
|
246
|
+
"stable",
|
|
247
|
+
"beta",
|
|
248
|
+
"dev",
|
|
249
|
+
"canary"
|
|
250
|
+
], "Chrome channel", { default: "stable" }).string("userDataDir", "Chrome profile directory").query().openWorld()),
|
|
251
|
+
tool("browser_select_tab", (t) => t.desc("Switch active tab.").number("index", "Tab index").string("urlPattern", "URL substring match").string("titlePattern", "Title substring match").idempotent()),
|
|
252
|
+
tool("framework_state_extract", (t) => t.desc("Extract framework component state.").enum("framework", [
|
|
253
|
+
"auto",
|
|
254
|
+
"react",
|
|
255
|
+
"vue2",
|
|
256
|
+
"vue3",
|
|
257
|
+
"svelte",
|
|
258
|
+
"solid",
|
|
259
|
+
"preact"
|
|
260
|
+
], "Framework", { default: "auto" }).string("selector", "Root element CSS selector").number("maxDepth", "Max traversal depth", { default: 5 }).query().openWorld()),
|
|
261
|
+
tool("indexeddb_dump", (t) => t.desc("Dump IndexedDB contents.").string("database", "Database name").string("store", "Object store name").number("maxRecords", "Max records per store", { default: 100 }).query()),
|
|
262
|
+
tool("camoufox_geolocation", (t) => t.desc("Get geolocation for a locale.").string("locale", "Locale string").string("proxy", "Proxy URL for IP lookup").required("locale").query())
|
|
263
|
+
];
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/server/domains/browser/definitions.tools.behavior.ts
|
|
266
|
+
const behaviorTools = [
|
|
267
|
+
tool("captcha_solver_capabilities", (t) => t.desc("Report CAPTCHA solving mode availability.").query()),
|
|
268
|
+
tool("human_mouse", (t) => t.desc("Move mouse along a Bezier curve with jitter.").number("fromX", "Start X").number("fromY", "Start Y").number("toX", "Target X").number("toY", "Target Y").string("selector", "CSS selector (alternative to toX/toY)").number("durationMs", "Duration ms", { default: 600 }).number("steps", "Intermediate points", { default: 24 }).number("jitterPx", "Max jitter px", { default: 1.5 }).enum("curve", [
|
|
269
|
+
"ease",
|
|
270
|
+
"linear",
|
|
271
|
+
"ease-in",
|
|
272
|
+
"ease-out"
|
|
273
|
+
], "Speed curve", { default: "ease" }).boolean("click", "Click at destination", { default: false }).openWorld()),
|
|
274
|
+
tool("human_scroll", (t) => t.desc("Scroll with human-like speed variation.").number("distance", "Distance px", { default: 500 }).enum("direction", [
|
|
275
|
+
"up",
|
|
276
|
+
"down",
|
|
277
|
+
"left",
|
|
278
|
+
"right"
|
|
279
|
+
], "Direction", { default: "down" }).number("durationMs", "Duration ms", { default: 1500 }).number("segments", "Segments", { default: 8 }).number("pauseMs", "Pause between segments ms", { default: 80 }).number("jitter", "Variation factor 0-1", { default: .3 }).string("selector", "Scrollable container selector").openWorld()),
|
|
280
|
+
tool("human_typing", (t) => t.desc("Type text with human-like speed and occasional typos.").string("selector", "CSS selector").string("text", "Text to type").number("wpm", "Words per minute", { default: 90 }).number("errorRate", "Typo probability per char", { default: .02 }).number("correctDelayMs", "Delay before correcting typo ms", { default: 200 }).boolean("clearFirst", "Clear existing value first", { default: false }).requiredOpenWorld("selector", "text")),
|
|
281
|
+
tool("captcha_vision_solve", (t) => t.desc("Solve a CAPTCHA with manual flow or a configured external service.").enum("mode", ["external_service", "manual"], "Solver mode").string("provider", "External solver provider").string("apiKey", "API key").enum("challengeType", [
|
|
282
|
+
"image",
|
|
283
|
+
"widget",
|
|
284
|
+
"browser_check",
|
|
285
|
+
"auto"
|
|
286
|
+
], "Challenge type", { default: "auto" }).string("typeHint", "Legacy alias for challengeType").string("siteKey", "Widget site key").string("pageUrl", "Page URL").number("timeoutMs", "Timeout ms", { default: 18e4 }).number("maxRetries", "Max retries", { default: 2 }).openWorld()),
|
|
287
|
+
tool("widget_challenge_solve", (t) => t.desc("Solve a widget challenge with hook, manual, or configured external service.").string("siteKey", "Widget site key").string("pageUrl", "Page URL").enum("mode", [
|
|
288
|
+
"external_service",
|
|
289
|
+
"hook",
|
|
290
|
+
"manual"
|
|
291
|
+
], "Solving mode").string("provider", "External solver provider").string("apiKey", "API key").number("timeoutMs", "Timeout ms", { default: 12e4 }).boolean("injectToken", "Auto-inject token", { default: true }).openWorld())
|
|
292
|
+
];
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/server/domains/browser/definitions.tools.jsdom.ts
|
|
295
|
+
/**
|
|
296
|
+
* jsdom-backed headless DOM tools.
|
|
297
|
+
*
|
|
298
|
+
* Operate on an in-memory JSDOM session (no browser required). Each session
|
|
299
|
+
* is referenced by `sessionId` returned from `browser_jsdom_parse`; sessions
|
|
300
|
+
* auto-expire after 10 minutes of inactivity.
|
|
301
|
+
*/
|
|
302
|
+
const browserJsdomToolDefinitions = [
|
|
303
|
+
tool("browser_jsdom_parse", (t) => t.desc("Parse HTML into an in-memory JSDOM session. No browser needed.").string("html", "HTML source").string("url", "Document URL").string("contentType", "Content-Type").enum("runScripts", [
|
|
304
|
+
"none",
|
|
305
|
+
"outside-only",
|
|
306
|
+
"dangerously"
|
|
307
|
+
], "Script execution mode", { default: "none" }).boolean("includeNodeLocations", "Track source offsets", { default: false }).boolean("pretendToBeVisual", "Expose rAF/matchMedia shims", { default: false }).string("referrer", "Referrer URL").number("storageQuotaBytes", "Storage quota bytes", { default: 5e6 }).required("html").query()),
|
|
308
|
+
tool("browser_jsdom_query", (t) => t.desc("Query a JSDOM session with a CSS selector.").string("sessionId", "Session ID").string("selector", "CSS selector").number("maxResults", "Max matches", { default: 50 }).array("attributes", { type: "string" }, "Attribute whitelist").boolean("includeText", "Include textContent", { default: true }).boolean("includeHtml", "Include outerHTML", { default: false }).boolean("includeLocation", "Include source offsets", { default: false }).required("sessionId", "selector").query()),
|
|
309
|
+
tool("browser_jsdom_execute", (t) => t.desc("Evaluate JS inside a JSDOM session.").string("sessionId", "Session ID").string("code", "JavaScript code").number("timeoutMs", "Timeout hint ms", { default: 5e3 }).required("sessionId", "code")),
|
|
310
|
+
tool("browser_jsdom_serialize", (t) => t.desc("Serialize a JSDOM session to HTML.").string("sessionId", "Session ID").string("selector", "CSS selector for a fragment").boolean("pretty", "Pretty-print", { default: false }).required("sessionId").query()),
|
|
311
|
+
tool("browser_jsdom_cookies", (t) => t.desc("Manage cookies on a JSDOM session. Isolated from the attached browser.").string("sessionId", "Session ID").enum("action", [
|
|
312
|
+
"get",
|
|
313
|
+
"set",
|
|
314
|
+
"clear"
|
|
315
|
+
], "Action", { default: "get" }).string("url", "URL scope").object("cookie", {
|
|
316
|
+
name: {
|
|
317
|
+
type: "string",
|
|
318
|
+
description: "Name"
|
|
319
|
+
},
|
|
320
|
+
value: {
|
|
321
|
+
type: "string",
|
|
322
|
+
description: "Value"
|
|
323
|
+
},
|
|
324
|
+
domain: {
|
|
325
|
+
type: "string",
|
|
326
|
+
description: "Domain"
|
|
327
|
+
},
|
|
328
|
+
path: {
|
|
329
|
+
type: "string",
|
|
330
|
+
description: "Path"
|
|
331
|
+
},
|
|
332
|
+
expires: {
|
|
333
|
+
type: "string",
|
|
334
|
+
description: "Expiration"
|
|
335
|
+
},
|
|
336
|
+
httpOnly: {
|
|
337
|
+
type: "boolean",
|
|
338
|
+
description: "HttpOnly"
|
|
339
|
+
},
|
|
340
|
+
secure: {
|
|
341
|
+
type: "boolean",
|
|
342
|
+
description: "Secure"
|
|
343
|
+
},
|
|
344
|
+
sameSite: {
|
|
345
|
+
type: "string",
|
|
346
|
+
description: "SameSite"
|
|
347
|
+
},
|
|
348
|
+
raw: {
|
|
349
|
+
type: "string",
|
|
350
|
+
description: "Raw Set-Cookie string"
|
|
351
|
+
}
|
|
352
|
+
}, "Cookie (action=set)").destructive().requiredOpenWorld("sessionId"))
|
|
353
|
+
];
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/server/domains/browser/definitions.tools.ts
|
|
356
|
+
const browserTools = [
|
|
357
|
+
...browserRuntimeTools,
|
|
358
|
+
...browserPageCoreTools,
|
|
359
|
+
...browserPageSystemTools,
|
|
360
|
+
...browserSecurityStateTools,
|
|
361
|
+
...behaviorTools,
|
|
362
|
+
...browserJsdomToolDefinitions
|
|
363
|
+
];
|
|
364
|
+
//#endregion
|
|
365
|
+
export { advancedBrowserToolDefinitions as n, browserTools as t };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { t as tool } from "./tool-builder-BHJp32mV.mjs";
|
|
2
|
+
//#region src/server/domains/debugger/definitions.tools.core.ts
|
|
3
|
+
const DEBUGGER_CORE_TOOLS = [
|
|
4
|
+
tool("debugger_lifecycle", (t) => t.desc("Manage the debugger lifecycle (enable or disable)").enum("action", ["enable", "disable"], "Action to perform").required("action").idempotent()),
|
|
5
|
+
tool("debugger_pause", (t) => t.desc("Pause execution at the next statement")),
|
|
6
|
+
tool("debugger_resume", (t) => t.desc("Resume execution (continue)")),
|
|
7
|
+
tool("debugger_step", (t) => t.desc("Step execution: into (enter next call), over (skip next call), out (exit current function).").enum("direction", [
|
|
8
|
+
"into",
|
|
9
|
+
"over",
|
|
10
|
+
"out"
|
|
11
|
+
], "Step direction").required("direction")),
|
|
12
|
+
tool("breakpoint", (t) => t.desc(`Manage breakpoints: code (line/script), XHR (URL pattern), event listener, event category, and exception breakpoints.
|
|
13
|
+
|
|
14
|
+
Actions:
|
|
15
|
+
- set: Create a breakpoint. Type determines required params.
|
|
16
|
+
- remove: Remove a breakpoint by ID.
|
|
17
|
+
- list: List active breakpoints of the given type.
|
|
18
|
+
|
|
19
|
+
Types & params:
|
|
20
|
+
- code: lineNumber (required), scriptId?, columnNumber?, condition?
|
|
21
|
+
- xhr: urlPattern (required for set)
|
|
22
|
+
- event: eventName (required for set), targetName?
|
|
23
|
+
- event_category: category (required for set)
|
|
24
|
+
- exception: state (required for set)`).enum("action", [
|
|
25
|
+
"set",
|
|
26
|
+
"remove",
|
|
27
|
+
"list"
|
|
28
|
+
], "Breakpoint operation").enum("type", [
|
|
29
|
+
"code",
|
|
30
|
+
"xhr",
|
|
31
|
+
"event",
|
|
32
|
+
"event_category",
|
|
33
|
+
"exception"
|
|
34
|
+
], "Breakpoint type (default: code)", { default: "code" }).string("url", "Script URL (type=code, alternative to scriptId)").string("scriptId", "Script ID (type=code)").number("lineNumber", "Line number 0-based (type=code, action=set)").number("columnNumber", "Column number 0-based (type=code)").string("condition", "Conditional expression (type=code)").string("urlPattern", "URL pattern with wildcards (type=xhr, action=set)").string("eventName", "Event name e.g. \"click\" (type=event, action=set)").string("targetName", "Target name e.g. \"WebSocket\" (type=event)").enum("category", [
|
|
35
|
+
"mouse",
|
|
36
|
+
"keyboard",
|
|
37
|
+
"timer",
|
|
38
|
+
"websocket"
|
|
39
|
+
], "Event category (type=event_category)").enum("state", [
|
|
40
|
+
"none",
|
|
41
|
+
"uncaught",
|
|
42
|
+
"all"
|
|
43
|
+
], "Exception pause state (type=exception)").string("breakpointId", "Breakpoint ID (action=remove)").required("action").idempotent()),
|
|
44
|
+
tool("get_call_stack", (t) => t.desc("Get the current call stack (only available when paused at a breakpoint)").query()),
|
|
45
|
+
tool("debugger_evaluate", (t) => t.desc("Evaluate a JavaScript expression. context=\"frame\" evaluates in the current call frame (requires paused state); context=\"global\" evaluates in the global context (no pause required).").enum("context", ["frame", "global"], "Evaluation context", { default: "frame" }).string("expression", "JavaScript expression to evaluate").string("callFrameId", "Call frame ID (for context=frame; from get_call_stack, defaults to current frame)").requiredOpenWorld("expression")),
|
|
46
|
+
tool("debugger_wait_for_paused", (t) => t.desc("Wait for the debugger to pause (useful after setting breakpoints and triggering code)").number("timeout", "Timeout in milliseconds (default: 30000)", {
|
|
47
|
+
default: 3e4,
|
|
48
|
+
minimum: 1e3,
|
|
49
|
+
maximum: 12e4
|
|
50
|
+
}).query()),
|
|
51
|
+
tool("debugger_get_paused_state", (t) => t.desc("Get the current paused state (check if debugger is paused and why)").query()),
|
|
52
|
+
tool("get_object_properties", (t) => t.desc("Get all properties of an object (when paused, use objectId from variables)").string("objectId", "Object ID (from get_scope_variables)").required("objectId").query()),
|
|
53
|
+
tool("get_scope_variables_enhanced", (t) => t.desc(`Enhanced scope variable inspection with deep object traversal.`).string("callFrameId", "Call frame ID (from get_call_stack, defaults to current frame)").boolean("includeObjectProperties", "Expand object properties recursively (default: false)", { default: false }).number("maxDepth", "Maximum traversal depth for nested objects (default: 1)", {
|
|
54
|
+
default: 1,
|
|
55
|
+
minimum: 1,
|
|
56
|
+
maximum: 10
|
|
57
|
+
}).boolean("skipErrors", "Skip properties that throw errors during access (default: true)", { default: true }).query()),
|
|
58
|
+
tool("debugger_session", (t) => t.desc("Manage debugger sessions. Actions: save (persist current session to file), load (restore session from file/JSON), export (export session as JSON string), list (list saved sessions in ./debugger-sessions/).").enum("action", [
|
|
59
|
+
"save",
|
|
60
|
+
"load",
|
|
61
|
+
"export",
|
|
62
|
+
"list"
|
|
63
|
+
], "Session operation").string("filePath", "File path for save/load actions").string("sessionData", "Session JSON string for load action (alternative to filePath)").object("metadata", {}, "Optional metadata for save/export actions").required("action"))
|
|
64
|
+
];
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/server/domains/debugger/definitions.tools.advanced.ts
|
|
67
|
+
const DEBUGGER_ADVANCED_TOOLS = [
|
|
68
|
+
tool("watch", (t) => t.desc(`Manage watch expressions for monitoring variable values during debugging.
|
|
69
|
+
|
|
70
|
+
Actions:
|
|
71
|
+
- add: Add a watch expression (requires expression)
|
|
72
|
+
- remove: Remove by watchId
|
|
73
|
+
- list: List all watches
|
|
74
|
+
- evaluate_all: Evaluate all enabled watches (optional callFrameId)
|
|
75
|
+
- clear_all: Clear all watches`).enum("action", [
|
|
76
|
+
"add",
|
|
77
|
+
"remove",
|
|
78
|
+
"list",
|
|
79
|
+
"evaluate_all",
|
|
80
|
+
"clear_all"
|
|
81
|
+
], "Watch operation").string("expression", "JavaScript expression to watch (action=add)").string("name", "Friendly name for the watch (action=add)").string("watchId", "Watch expression ID (action=remove)").string("callFrameId", "Call frame ID (action=evaluate_all)").required("action")),
|
|
82
|
+
tool("blackbox_add", (t) => t.desc(`Blackbox scripts (skip during debugging)
|
|
83
|
+
|
|
84
|
+
Usage:
|
|
85
|
+
- Skip third-party library c...`).string("urlPattern", "URL pattern to blackbox (supports wildcards *)").required("urlPattern").idempotent()),
|
|
86
|
+
tool("blackbox_add_common", (t) => t.desc(`Blackbox all common libraries (one-click)
|
|
87
|
+
|
|
88
|
+
Includes:
|
|
89
|
+
- jquery, react, vue, an...`).idempotent()),
|
|
90
|
+
tool("blackbox_list", (t) => t.desc("List all blackboxed patterns").query())
|
|
91
|
+
];
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/server/domains/debugger/definitions.tools.ts
|
|
94
|
+
const debuggerTools = [...DEBUGGER_CORE_TOOLS, ...DEBUGGER_ADVANCED_TOOLS];
|
|
95
|
+
//#endregion
|
|
96
|
+
export { debuggerTools as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as tool } from "./tool-builder-BHJp32mV.mjs";
|
|
2
|
+
//#region src/server/domains/coordination/definitions.ts
|
|
3
|
+
const coordinationTools = [
|
|
4
|
+
tool("create_task_handoff", (t) => t.desc("Create an in-session task handoff.").string("description", "Task description").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.").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.").string("taskId", "Optional task ID to read a single handoff").query()),
|
|
7
|
+
tool("append_session_insight", (t) => t.desc("Append a session insight.").string("category", "Insight category").string("content", "The insight content").number("confidence", "Confidence level 0.0-1.0", {
|
|
8
|
+
minimum: 0,
|
|
9
|
+
maximum: 1,
|
|
10
|
+
default: 1
|
|
11
|
+
}).required("category", "content")),
|
|
12
|
+
tool("save_page_snapshot", (t) => t.desc("Save current page state.").string("label", "Human-readable label for this snapshot").readOnly()),
|
|
13
|
+
tool("restore_page_snapshot", (t) => t.desc("Restore a saved page snapshot.").string("snapshotId", "Snapshot ID from save_page_snapshot").required("snapshotId").idempotent()),
|
|
14
|
+
tool("list_page_snapshots", (t) => t.desc("List saved page snapshots.").query())
|
|
15
|
+
];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { coordinationTools as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as tool } from "./tool-builder-BHJp32mV.mjs";
|
|
2
|
+
//#region src/server/domains/hooks/definitions.ts
|
|
3
|
+
const aiHookTools = [tool("ai_hook", (t) => t.desc("Manage AI hooks. Actions: inject (inject code into page), get_data (retrieve captured hook data), list (all active hooks), clear (remove hook data by id or all), toggle (enable/disable a hook), export (export data as JSON/CSV).").enum("action", [
|
|
4
|
+
"inject",
|
|
5
|
+
"get_data",
|
|
6
|
+
"list",
|
|
7
|
+
"clear",
|
|
8
|
+
"toggle",
|
|
9
|
+
"export"
|
|
10
|
+
], "Operation to perform").string("hookId", "Hook identifier (required for inject/get_data/toggle; optional for clear/export)").string("code", "Hook code to inject (required for action=inject)").enum("method", ["evaluateOnNewDocument", "evaluate"], "Injection method (for action=inject)", { default: "evaluate" }).boolean("enabled", "Enable or disable hook (required for action=toggle)").enum("format", ["json", "csv"], "Export format (for action=export)", { default: "json" }).required("action"))];
|
|
11
|
+
const hookPresetTools = [tool("hook_preset", (t) => t.desc("Install a pre-built JavaScript hook from 20+ built-in presets (eval, atob/btoa, Proxy, Reflect, Object.defineProperty, etc.), or provide customTemplate/customTemplates to install your own reusable hook bodies. Use listPresets=true to see all available preset descriptions.").string("preset", "Single preset name to install. Accepts built-in preset ids or ids provided by customTemplate/customTemplates.").array("presets", { type: "string" }, "List of preset names to install simultaneously. Accepts built-in ids and custom template ids.").prop("customTemplate", {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
id: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "Stable preset id, for example deobfuscation-sinks"
|
|
17
|
+
},
|
|
18
|
+
description: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Human-readable description for listPresets output."
|
|
21
|
+
},
|
|
22
|
+
body: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Hook body snippet inserted into the preset wrapper."
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
required: ["id", "body"],
|
|
28
|
+
description: "Inline custom template. body should contain the hook body inserted into the standard buildHookCode wrapper. Use {{STACK_CODE}} and {{LOG_FN}} placeholders when needed."
|
|
29
|
+
}).prop("customTemplates", {
|
|
30
|
+
type: "array",
|
|
31
|
+
items: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
id: { type: "string" },
|
|
35
|
+
description: { type: "string" },
|
|
36
|
+
body: { type: "string" }
|
|
37
|
+
},
|
|
38
|
+
required: ["id", "body"]
|
|
39
|
+
},
|
|
40
|
+
description: "List of inline custom templates to register for this invocation."
|
|
41
|
+
}).boolean("captureStack", "Include call stack in captured data (has performance impact)", { default: false }).boolean("logToConsole", "Log hook events to browser console", { default: true }).enum("method", ["evaluate", "evaluateOnNewDocument"], "Injection method: evaluate=current page, evaluateOnNewDocument=before page scripts", { default: "evaluate" }).boolean("listPresets", "Set to true to list all available presets with descriptions instead of installing.", { default: false }))];
|
|
42
|
+
//#endregion
|
|
43
|
+
export { hookPresetTools as n, aiHookTools as t };
|