@jshookmcp/jshook 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +145 -100
  3. package/README.zh.md +81 -36
  4. package/dist/constants.d.ts +1 -1
  5. package/dist/constants.js +3 -1
  6. package/dist/index.js +0 -0
  7. package/dist/modules/analyzer/QualityAnalyzer.js +1 -1
  8. package/dist/modules/browser/BrowserDiscovery.js +2 -2
  9. package/dist/modules/browser/BrowserModeManager.js +3 -3
  10. package/dist/modules/captcha/AICaptchaDetector.d.ts +12 -16
  11. package/dist/modules/captcha/AICaptchaDetector.js +229 -209
  12. package/dist/modules/captcha/CaptchaDetector.constants.d.ts +2 -0
  13. package/dist/modules/captcha/CaptchaDetector.constants.js +116 -25
  14. package/dist/modules/captcha/CaptchaDetector.d.ts +2 -11
  15. package/dist/modules/captcha/CaptchaDetector.js +102 -51
  16. package/dist/modules/captcha/types.d.ts +46 -0
  17. package/dist/modules/captcha/types.js +52 -0
  18. package/dist/modules/deobfuscator/AdvancedDeobfuscator.d.ts +15 -20
  19. package/dist/modules/deobfuscator/AdvancedDeobfuscator.js +66 -234
  20. package/dist/modules/deobfuscator/Deobfuscator.d.ts +3 -10
  21. package/dist/modules/deobfuscator/Deobfuscator.js +125 -404
  22. package/dist/modules/deobfuscator/webcrack.d.ts +13 -0
  23. package/dist/modules/deobfuscator/webcrack.js +164 -0
  24. package/dist/modules/detector/ObfuscationDetector.d.ts +6 -0
  25. package/dist/modules/detector/ObfuscationDetector.js +53 -2
  26. package/dist/modules/hook/AIHookGenerator.js +1 -1
  27. package/dist/modules/process/MacProcessManager.js +25 -25
  28. package/dist/modules/process/memory/availability.js +49 -49
  29. package/dist/modules/process/memory/injector.js +185 -185
  30. package/dist/modules/process/memory/reader.js +50 -50
  31. package/dist/modules/process/memory/scanner.js +165 -165
  32. package/dist/modules/process/memory/writer.js +55 -55
  33. package/dist/native/scripts/linux/enum-windows.sh +12 -12
  34. package/dist/native/scripts/macos/enum-windows.applescript +22 -22
  35. package/dist/native/scripts/windows/enum-windows-by-class.ps1 +51 -51
  36. package/dist/native/scripts/windows/enum-windows.ps1 +44 -44
  37. package/dist/native/scripts/windows/inject-dll.ps1 +21 -21
  38. package/dist/server/domains/analysis/definitions.js +223 -2
  39. package/dist/server/domains/analysis/handlers.impl.d.ts +2 -3
  40. package/dist/server/domains/analysis/handlers.impl.js +60 -15
  41. package/dist/server/domains/analysis/manifest.js +2 -5
  42. package/dist/server/domains/browser/definitions.tools.behavior.js +36 -24
  43. package/dist/server/domains/browser/definitions.tools.page-core.js +53 -53
  44. package/dist/server/domains/browser/definitions.tools.runtime.js +40 -40
  45. package/dist/server/domains/browser/definitions.tools.security.js +80 -77
  46. package/dist/server/domains/browser/handlers/camoufox-flow.js +0 -1
  47. package/dist/server/domains/browser/handlers/captcha-solver.d.ts +1 -1
  48. package/dist/server/domains/browser/handlers/captcha-solver.js +121 -54
  49. package/dist/server/domains/browser/handlers/page-navigation.js +0 -2
  50. package/dist/server/domains/browser/handlers.impl.d.ts +1 -1
  51. package/dist/server/domains/browser/handlers.impl.js +3 -3
  52. package/dist/server/domains/browser/manifest.js +1 -1
  53. package/dist/server/domains/shared/modules.d.ts +1 -0
  54. package/dist/server/domains/transform/handlers.impl.transform-base.js +102 -102
  55. package/dist/server/domains/workflow/handlers.impl.workflow-base.js +51 -51
  56. package/dist/types/deobfuscator.d.ts +43 -1
  57. package/dist/types/index.d.ts +1 -1
  58. package/dist/utils/config.js +19 -10
  59. package/package.json +30 -44
  60. package/scripts/postinstall.cjs +37 -0
  61. package/src/native/scripts/linux/enum-windows.sh +12 -12
  62. package/src/native/scripts/macos/enum-windows.applescript +22 -22
  63. package/src/native/scripts/windows/enum-windows-by-class.ps1 +51 -51
  64. package/src/native/scripts/windows/enum-windows.ps1 +44 -44
  65. package/src/native/scripts/windows/inject-dll.ps1 +21 -21
@@ -6,7 +6,7 @@ export const behaviorTools = [
6
6
  '- Non-linear speed (ease-in-out)\n' +
7
7
  '- Configurable jitter/noise\n' +
8
8
  '- Viewport-clamped trajectory\n\n' +
9
- 'Use this before page_click for anti-bot bypass (e.g. Cloudflare, Turnstile).\n\n' +
9
+ 'Use this before page_click for anti-bot bypass on browser-check or widget challenges.\n\n' +
10
10
  'Example:\n' +
11
11
  ' human_mouse({ toX: 500, toY: 300, durationMs: 800 })',
12
12
  inputSchema: {
@@ -74,28 +74,36 @@ export const behaviorTools = [
74
74
  {
75
75
  name: 'captcha_vision_solve',
76
76
  description: 'Attempt to solve a CAPTCHA using an external solving service or AI vision.\n\n' +
77
- 'Supports multiple providers through a provider-agnostic interface:\n' +
78
- '- `2captcha` / `anticaptcha` / `capsolver` external solving services\n' +
79
- '- `manual` wait for user to solve manually (fallback)\n\n' +
80
- 'Automatically detects CAPTCHA type (image, reCAPTCHA, hCaptcha) if typeHint is not provided.\n\n' +
77
+ 'Public contract:\n' +
78
+ '- `mode: "external_service"` routes to the configured solver backend\n' +
79
+ '- `mode: "manual"` waits for the user to solve manually\n\n' +
80
+ 'Automatically detects the challenge class (`image` or `widget`) if `challengeType` is omitted.\n\n' +
81
81
  'Example:\n' +
82
- ' captcha_vision_solve({ provider: "2captcha", apiKey: "..." })',
82
+ ' captcha_vision_solve({ mode: "external_service", apiKey: "..." })',
83
83
  inputSchema: {
84
84
  type: 'object',
85
85
  properties: {
86
+ mode: {
87
+ type: 'string',
88
+ enum: ['external_service', 'manual'],
89
+ description: 'Solver mode (default: from config or "manual")',
90
+ },
86
91
  provider: {
87
92
  type: 'string',
88
- enum: ['2captcha', 'anticaptcha', 'capsolver', 'manual'],
89
- description: 'Solving service provider (default: from config or "manual")',
93
+ description: 'Deprecated legacy external-service override; avoid in new callers',
90
94
  },
91
- apiKey: { type: 'string', description: 'Provider API key (default: from CAPTCHA_API_KEY env)' },
92
- typeHint: {
95
+ apiKey: { type: 'string', description: 'External solver API key (default: from CAPTCHA_API_KEY env)' },
96
+ challengeType: {
93
97
  type: 'string',
94
- enum: ['image', 'recaptcha_v2', 'recaptcha_v3', 'hcaptcha', 'funcaptcha', 'turnstile', 'auto'],
95
- description: 'CAPTCHA type hint (default: auto-detect)',
98
+ enum: ['image', 'widget', 'browser_check', 'auto'],
99
+ description: 'Generic challenge type hint (default: auto-detect)',
96
100
  default: 'auto',
97
101
  },
98
- siteKey: { type: 'string', description: 'Site key for reCAPTCHA/hCaptcha/Turnstile (auto-extracted if omitted)' },
102
+ typeHint: {
103
+ type: 'string',
104
+ description: 'Deprecated legacy alias for challengeType; avoid in new callers',
105
+ },
106
+ siteKey: { type: 'string', description: 'Widget site key (auto-extracted if omitted)' },
99
107
  pageUrl: { type: 'string', description: 'Page URL for context (auto-detected if omitted)' },
100
108
  timeoutMs: { type: 'number', description: 'Max solve time in ms (default: 180000)', default: 180000 },
101
109
  maxRetries: { type: 'integer', description: 'Max retry attempts (default: 2)', default: 2 },
@@ -103,27 +111,31 @@ export const behaviorTools = [
103
111
  },
104
112
  },
105
113
  {
106
- name: 'turnstile_solve',
107
- description: 'Solve a Cloudflare Turnstile challenge specifically.\n\n' +
114
+ name: 'widget_challenge_solve',
115
+ description: 'Solve an embedded widget challenge.\n\n' +
108
116
  'Strategy:\n' +
109
- '1. Detect Turnstile widget and extract siteKey\n' +
110
- '2. Send to solving service (or hook window.cf to extract token)\n' +
111
- '3. Inject solved token back into the page\n' +
117
+ '1. Detect the widget and extract siteKey\n' +
118
+ '2. Send to the configured external solver service (or hook the page callback to extract token)\n' +
119
+ '3. Inject the solved token back into the page\n' +
112
120
  '4. Trigger callback to proceed\n\n' +
113
- 'Requires either an external solver API key or uses the built-in hook approach.\n\n' +
121
+ 'Requires either external solver credentials or uses the built-in hook approach.\n\n' +
114
122
  'Example:\n' +
115
- ' turnstile_solve({ provider: "capsolver" })',
123
+ ' widget_challenge_solve({ mode: "external_service" })',
116
124
  inputSchema: {
117
125
  type: 'object',
118
126
  properties: {
119
- siteKey: { type: 'string', description: 'Turnstile site key (auto-detected if omitted)' },
127
+ siteKey: { type: 'string', description: 'Widget site key (auto-detected if omitted)' },
120
128
  pageUrl: { type: 'string', description: 'Page URL (auto-detected if omitted)' },
129
+ mode: {
130
+ type: 'string',
131
+ enum: ['external_service', 'hook', 'manual'],
132
+ description: 'Solving mode (default: from config or "manual")',
133
+ },
121
134
  provider: {
122
135
  type: 'string',
123
- enum: ['2captcha', 'anticaptcha', 'capsolver', 'hook', 'manual'],
124
- description: 'Solving method (default: from config or "manual")',
136
+ description: 'Deprecated legacy external-service override; avoid in new callers',
125
137
  },
126
- apiKey: { type: 'string', description: 'Provider API key' },
138
+ apiKey: { type: 'string', description: 'External solver API key' },
127
139
  timeoutMs: { type: 'number', description: 'Max solve time in ms (default: 120000)', default: 120000 },
128
140
  injectToken: { type: 'boolean', description: 'Auto-inject solved token into page (default: true)', default: true },
129
141
  },
@@ -1,22 +1,22 @@
1
1
  export const browserPageCoreTools = [
2
2
  {
3
3
  name: 'page_navigate',
4
- description: `Navigate to a URL
5
-
6
- Features:
7
- - Automatic CAPTCHA detection
8
- - Optional network monitoring (set enableNetworkMonitoring=true to auto-enable)
9
- - Waits for page load based on waitUntil strategy
10
-
11
- Network Monitoring:
12
- If you want to capture network requests, you have two options:
13
- 1. Call network_enable before page_navigate (recommended for full control)
14
- 2. Set enableNetworkMonitoring=true in page_navigate (convenient for quick capture)
15
-
16
- Example with network monitoring:
17
- page_navigate(url="https:
18
- -> Network monitoring auto-enabled
19
- -> Page loads
4
+ description: `Navigate to a URL
5
+
6
+ Features:
7
+ - Automatic CAPTCHA detection
8
+ - Optional network monitoring (set enableNetworkMonitoring=true to auto-enable)
9
+ - Waits for page load based on waitUntil strategy
10
+
11
+ Network Monitoring:
12
+ If you want to capture network requests, you have two options:
13
+ 1. Call network_enable before page_navigate (recommended for full control)
14
+ 2. Set enableNetworkMonitoring=true in page_navigate (convenient for quick capture)
15
+
16
+ Example with network monitoring:
17
+ page_navigate(url="https:
18
+ -> Network monitoring auto-enabled
19
+ -> Page loads
20
20
  -> Use network_get_requests to see captured requests`,
21
21
  inputSchema: {
22
22
  type: 'object',
@@ -109,17 +109,17 @@ page_navigate(url="https:
109
109
  },
110
110
  {
111
111
  name: 'dom_get_structure',
112
- description: `Get page DOM structure (for AI to understand page layout).
113
-
114
- IMPORTANT: Large DOM structures (>50KB) automatically return summary + detailId.
115
-
116
- Best Practices:
117
- 1. Use maxDepth=2 for initial exploration (faster, smaller)
118
- 2. Use maxDepth=3 only when needed (may be large)
119
- 3. Set includeText=false to reduce size if text not needed
120
-
121
- Example:
122
- dom_get_structure(maxDepth=2, includeText=false)
112
+ description: `Get page DOM structure (for AI to understand page layout).
113
+
114
+ IMPORTANT: Large DOM structures (>50KB) automatically return summary + detailId.
115
+
116
+ Best Practices:
117
+ 1. Use maxDepth=2 for initial exploration (faster, smaller)
118
+ 2. Use maxDepth=3 only when needed (may be large)
119
+ 3. Set includeText=false to reduce size if text not needed
120
+
121
+ Example:
122
+ dom_get_structure(maxDepth=2, includeText=false)
123
123
  -> Returns compact structure without text content`,
124
124
  inputSchema: {
125
125
  type: 'object',
@@ -276,19 +276,19 @@ dom_get_structure(maxDepth=2, includeText=false)
276
276
  },
277
277
  {
278
278
  name: 'page_evaluate',
279
- description: `Execute JavaScript code in page context and get result.
280
-
281
- IMPORTANT: Large results (>50KB) automatically return summary + detailId to prevent context overflow.
282
- Use get_detailed_data(detailId) to retrieve full data if needed.
283
-
284
- Best Practices:
285
- - Query specific properties: { hasAcrawler: !!window.byted_acrawler }
286
- - Return only needed data: Object.keys(window.byted_acrawler)
287
- - Avoid returning entire objects: window (too large!)
288
-
289
- Example:
290
- page_evaluate("({ keys: Object.keys(window.byted_acrawler), type: typeof window.byted_acrawler })")
291
- -> Returns small summary
279
+ description: `Execute JavaScript code in page context and get result.
280
+
281
+ IMPORTANT: Large results (>50KB) automatically return summary + detailId to prevent context overflow.
282
+ Use get_detailed_data(detailId) to retrieve full data if needed.
283
+
284
+ Best Practices:
285
+ - Query specific properties: { hasAcrawler: !!window.byted_acrawler }
286
+ - Return only needed data: Object.keys(window.byted_acrawler)
287
+ - Avoid returning entire objects: window (too large!)
288
+
289
+ Example:
290
+ page_evaluate("({ keys: Object.keys(window.byted_acrawler), type: typeof window.byted_acrawler })")
291
+ -> Returns small summary
292
292
  -> If you need full object, use the returned detailId`,
293
293
  inputSchema: {
294
294
  type: 'object',
@@ -369,19 +369,19 @@ page_evaluate("({ keys: Object.keys(window.byted_acrawler), type: typeof window.
369
369
  },
370
370
  {
371
371
  name: 'get_script_source',
372
- description: `Get source code of a specific script.
373
-
374
- IMPORTANT: Large scripts (>50KB) automatically return summary + detailId.
375
- Use preview mode first to check script size before fetching full source.
376
-
377
- Best Practices:
378
- 1. Use preview=true first to see script overview
379
- 2. If script is large, use detailId to get full source
380
- 3. Or use startLine/endLine to get specific sections
381
-
382
- Example:
383
- get_script_source(scriptId="abc", preview=true)
384
- -> Returns: { lines: 5000, size: "500KB", preview: "...", detailId: "..." }
372
+ description: `Get source code of a specific script.
373
+
374
+ IMPORTANT: Large scripts (>50KB) automatically return summary + detailId.
375
+ Use preview mode first to check script size before fetching full source.
376
+
377
+ Best Practices:
378
+ 1. Use preview=true first to see script overview
379
+ 2. If script is large, use detailId to get full source
380
+ 3. Or use startLine/endLine to get specific sections
381
+
382
+ Example:
383
+ get_script_source(scriptId="abc", preview=true)
384
+ -> Returns: { lines: 5000, size: "500KB", preview: "...", detailId: "..." }
385
385
  -> Then: get_detailed_data(detailId) to get full source`,
386
386
  inputSchema: {
387
387
  type: 'object',
@@ -1,14 +1,14 @@
1
1
  export const browserRuntimeTools = [
2
2
  {
3
3
  name: 'get_detailed_data',
4
- description: ` Retrieve detailed data using detailId token.
5
-
6
- When tools return large data, they provide a detailId instead of full data to prevent context overflow.
7
- Use this tool to retrieve the full data or specific parts.
8
-
9
- Examples:
10
- - get_detailed_data("detail_abc123") -> Get full data
11
- - get_detailed_data("detail_abc123", path="frontierSign") -> Get specific property
4
+ description: ` Retrieve detailed data using detailId token.
5
+
6
+ When tools return large data, they provide a detailId instead of full data to prevent context overflow.
7
+ Use this tool to retrieve the full data or specific parts.
8
+
9
+ Examples:
10
+ - get_detailed_data("detail_abc123") -> Get full data
11
+ - get_detailed_data("detail_abc123", path="frontierSign") -> Get specific property
12
12
  - get_detailed_data("detail_abc123", path="methods.0") -> Get first method`,
13
13
  inputSchema: {
14
14
  type: 'object',
@@ -27,18 +27,18 @@ Examples:
27
27
  },
28
28
  {
29
29
  name: 'browser_launch',
30
- description: `Launch browser instance.
31
-
32
- Drivers:
33
- - chrome (default): rebrowser-puppeteer-core, Chromium-based, full CDP support (debugger, network, stealth scripts, etc.)
34
- - camoufox: Firefox-based anti-detect browser, C++ engine-level fingerprint spoofing.
35
- Requires binaries first: npx camoufox-js fetch
36
- Note: CDP tools (debugger, network monitor, etc.) are not available in camoufox mode.
37
-
38
- Modes:
39
- - launch (default): launch a local browser instance
40
- - connect: reuse an existing browser instance
41
- - chrome: connect via browserURL (http://host:port) or wsEndpoint
30
+ description: `Launch browser instance.
31
+
32
+ Drivers:
33
+ - chrome (default): rebrowser-puppeteer-core, Chromium-based, full CDP support (debugger, network, stealth scripts, etc.)
34
+ - camoufox: Firefox-based anti-detect browser, C++ engine-level fingerprint spoofing.
35
+ Requires binaries first: npx camoufox-js fetch
36
+ Note: CDP tools (debugger, network monitor, etc.) are not available in camoufox mode.
37
+
38
+ Modes:
39
+ - launch (default): launch a local browser instance
40
+ - connect: reuse an existing browser instance
41
+ - chrome: connect via browserURL (http://host:port) or wsEndpoint
42
42
  - camoufox: connect via wsEndpoint from camoufox_server_launch`,
43
43
  inputSchema: {
44
44
  type: 'object',
@@ -79,16 +79,16 @@ Modes:
79
79
  },
80
80
  {
81
81
  name: 'camoufox_server_launch',
82
- description: `Launch a Camoufox WebSocket server for multi-process / remote connections.
83
-
84
- Use this when you need concurrent browser instances or want to manage the browser lifecycle separately from the automation client.
85
-
86
- Steps:
87
- 1. Call camoufox_server_launch → get wsEndpoint
88
- 2. Call browser_launch(driver="camoufox", mode="connect", wsEndpoint=<endpoint>) from one or more sessions
89
- 3. Use page_navigate and other tools normally
90
- 4. Call camoufox_server_close when done
91
-
82
+ description: `Launch a Camoufox WebSocket server for multi-process / remote connections.
83
+
84
+ Use this when you need concurrent browser instances or want to manage the browser lifecycle separately from the automation client.
85
+
86
+ Steps:
87
+ 1. Call camoufox_server_launch → get wsEndpoint
88
+ 2. Call browser_launch(driver="camoufox", mode="connect", wsEndpoint=<endpoint>) from one or more sessions
89
+ 3. Use page_navigate and other tools normally
90
+ 4. Call camoufox_server_close when done
91
+
92
92
  Requires binaries: npx camoufox-js fetch`,
93
93
  inputSchema: {
94
94
  type: 'object',
@@ -133,16 +133,16 @@ Requires binaries: npx camoufox-js fetch`,
133
133
  },
134
134
  {
135
135
  name: 'browser_attach',
136
- description: `Attach to an existing browser instance via Chrome DevTools Protocol (CDP).
137
-
138
- Use this when a browser is already running with remote debugging enabled.
139
- Supports both browserURL (http://host:port) and WebSocket endpoint (ws://...).
140
-
141
- Example:
142
- - browser_attach(browserURL="http://127.0.0.1:9222")
143
- - browser_attach(wsEndpoint="ws://127.0.0.1:9222/devtools/browser/xxx")
144
- - browser_attach(browserURL="http://127.0.0.1:9222", pageIndex=0)
145
-
136
+ description: `Attach to an existing browser instance via Chrome DevTools Protocol (CDP).
137
+
138
+ Use this when a browser is already running with remote debugging enabled.
139
+ Supports both browserURL (http://host:port) and WebSocket endpoint (ws://...).
140
+
141
+ Example:
142
+ - browser_attach(browserURL="http://127.0.0.1:9222")
143
+ - browser_attach(wsEndpoint="ws://127.0.0.1:9222/devtools/browser/xxx")
144
+ - browser_attach(browserURL="http://127.0.0.1:9222", pageIndex=0)
145
+
146
146
  After attaching, use page_navigate / page_screenshot / debugger_enable normally.`,
147
147
  inputSchema: {
148
148
  type: 'object',
@@ -1,32 +1,33 @@
1
1
  export const browserSecurityStateTools = [
2
2
  {
3
3
  name: 'captcha_detect',
4
- description: `Detect CAPTCHA on the current page using AI vision analysis.
5
-
6
- Detection process:
7
- 1. Takes a screenshot and analyzes it with AI (Vision LLM)
8
- 2. Applies rule-based detection as fallback if AI unavailable
9
- 3. Returns detection result with confidence score
10
-
11
- Supported CAPTCHA types:
12
- - Slider CAPTCHA: drag-to-verify style challenges
13
- - Image CAPTCHA: select-images challenges
14
- - reCAPTCHA / hCaptcha
15
- - Cloudflare Challenge
16
- - Custom CAPTCHA implementations
17
-
18
- Response fields:
19
- - detected: whether CAPTCHA was found
20
- - type: CAPTCHA type identifier
21
- - vendor: vendor name if identified
22
- - confidence: detection confidence (0-100)
23
- - reasoning: AI analysis explanation
24
- - screenshot: base64 screenshot (if MCP cannot view images, use external AI)
25
- - suggestions: recommended next steps
26
-
27
- Note:
28
- When the MCP LLM cannot access Vision API directly, the screenshot is provided as base64.
29
- Use an external AI (GPT-4o, Claude 3) to analyze the screenshot.`,
4
+ description: `Detect CAPTCHA on the current page using AI vision analysis.
5
+
6
+ Detection process:
7
+ 1. Takes a screenshot and analyzes it with AI (Vision LLM)
8
+ 2. Applies rule-based detection as fallback if AI unavailable
9
+ 3. Returns detection result with confidence score
10
+
11
+ Supported CAPTCHA types:
12
+ - Slider CAPTCHA: drag-to-verify style challenges
13
+ - Image CAPTCHA: select-images challenges
14
+ - Widget CAPTCHA: embedded checkbox or iframe-based challenges
15
+ - Browser Check: interstitial or automatic integrity checks
16
+ - Custom CAPTCHA implementations
17
+
18
+ Response fields:
19
+ - detected: whether CAPTCHA was found
20
+ - type: CAPTCHA type identifier
21
+ - providerHint: broad provider category if identified
22
+ - confidence: detection confidence (0-100)
23
+ - reasoning: AI analysis explanation
24
+ - screenshotPath: saved screenshot path when a vision-capable model is unavailable
25
+ - suggestions: recommended next steps
26
+
27
+ Note:
28
+ When the configured MCP model cannot access vision directly, the detector saves a screenshot
29
+ to disk and returns screenshotPath together with prompt guidance in the reasoning field.
30
+ Use an external AI (GPT-4o, Claude 3) to analyze the saved screenshot if needed.`,
30
31
  inputSchema: {
31
32
  type: 'object',
32
33
  properties: {},
@@ -34,14 +35,16 @@ Use an external AI (GPT-4o, Claude 3) to analyze the screenshot.`,
34
35
  },
35
36
  {
36
37
  name: 'captcha_wait',
37
- description: `Wait for the user to manually solve a CAPTCHA.
38
-
39
- Steps:
40
- 1. CAPTCHA is detected on the page
41
- 2. Browser switches to headed (visible) mode
42
- 3. User solves the CAPTCHA manually
43
- 4. Script resumes automatically after detection
44
-
38
+ description: `Wait for the user to manually solve a CAPTCHA.
39
+
40
+ Steps:
41
+ 1. CAPTCHA is detected on the page
42
+ 2. This tool polls the current page until the CAPTCHA is no longer detected
43
+ 3. User solves the CAPTCHA manually in the active browser/page
44
+ 4. Script resumes automatically after detection
45
+
46
+ Note: this tool does not switch browser modes on its own.
47
+
45
48
  Timeout: default 300000ms (5 minutes)`,
46
49
  inputSchema: {
47
50
  type: 'object',
@@ -56,11 +59,11 @@ Timeout: default 300000ms (5 minutes)`,
56
59
  },
57
60
  {
58
61
  name: 'captcha_config',
59
- description: `Configure CAPTCHA detection behavior.
60
-
61
- Parameters:
62
- - autoDetectCaptcha: auto-detect CAPTCHA after page_navigate (default: true)
63
- - autoSwitchHeadless: auto-switch to headed mode when CAPTCHA detected (default: true)
62
+ description: `Configure CAPTCHA detection behavior.
63
+
64
+ Parameters:
65
+ - autoDetectCaptcha: enable CAPTCHA auto-handling for browser-mode integrations that use these settings
66
+ - autoSwitchHeadless: allow supported integrations to switch to headed mode when CAPTCHA is detected
64
67
  - captchaTimeout: timeout for waiting user to solve CAPTCHA in ms (default: 300000)`,
65
68
  inputSchema: {
66
69
  type: 'object',
@@ -82,21 +85,21 @@ Parameters:
82
85
  },
83
86
  {
84
87
  name: 'stealth_inject',
85
- description: `Inject modern stealth scripts to bypass bot detection.
86
-
87
- Anti-detection patches:
88
- 1. Hide navigator.webdriver flag
89
- 2. Inject window.chrome object
90
- 3. Restore navigator.plugins
91
- 4. Fix Permissions API behavior
92
- 5. Patch Canvas fingerprinting
93
- 6. Patch WebGL fingerprinting
94
- 7. Restore hardware concurrency
95
- 8. Fix Battery API responses
96
- 9. Fix MediaDevices enumeration
97
- 10. Fix Notification API
98
-
99
- Compatible with undetected-chromedriver, puppeteer-extra-plugin-stealth, playwright-stealth.
88
+ description: `Inject modern stealth scripts to bypass bot detection.
89
+
90
+ Anti-detection patches:
91
+ 1. Hide navigator.webdriver flag
92
+ 2. Inject window.chrome object
93
+ 3. Restore navigator.plugins
94
+ 4. Fix Permissions API behavior
95
+ 5. Patch Canvas fingerprinting
96
+ 6. Patch WebGL fingerprinting
97
+ 7. Restore hardware concurrency
98
+ 8. Fix Battery API responses
99
+ 9. Fix MediaDevices enumeration
100
+ 10. Fix Notification API
101
+
102
+ Compatible with undetected-chromedriver, puppeteer-extra-plugin-stealth, playwright-stealth.
100
103
  Call after browser_launch for best results.`,
101
104
  inputSchema: {
102
105
  type: 'object',
@@ -105,10 +108,10 @@ Call after browser_launch for best results.`,
105
108
  },
106
109
  {
107
110
  name: 'stealth_set_user_agent',
108
- description: `Set a realistic User-Agent and browser fingerprint for the target platform.
109
-
110
- Updates navigator.userAgent, navigator.platform, navigator.vendor,
111
- navigator.hardwareConcurrency, and navigator.deviceMemory consistently
111
+ description: `Set a realistic User-Agent and browser fingerprint for the target platform.
112
+
113
+ Updates navigator.userAgent, navigator.platform, navigator.vendor,
114
+ navigator.hardwareConcurrency, and navigator.deviceMemory consistently
112
115
  to avoid fingerprint inconsistencies.`,
113
116
  inputSchema: {
114
117
  type: 'object',
@@ -124,17 +127,17 @@ to avoid fingerprint inconsistencies.`,
124
127
  },
125
128
  {
126
129
  name: 'browser_list_tabs',
127
- description: `List all open tabs/pages in the connected browser.
128
-
129
- Use this after browser_attach to see all available pages/tabs.
130
- Returns index, URL, and title for each tab.
131
-
132
- Workflow:
133
- 1. browser_attach(browserURL="http://127.0.0.1:9222")
134
- 2. browser_list_tabs() -> see all tabs with their indexes
135
- 3. browser_select_tab(index=N) -> switch to desired tab
136
-
137
- Can also connect and list in one call:
130
+ description: `List all open tabs/pages in the connected browser.
131
+
132
+ Use this after browser_attach to see all available pages/tabs.
133
+ Returns index, URL, and title for each tab.
134
+
135
+ Workflow:
136
+ 1. browser_attach(browserURL="http://127.0.0.1:9222")
137
+ 2. browser_list_tabs() -> see all tabs with their indexes
138
+ 3. browser_select_tab(index=N) -> switch to desired tab
139
+
140
+ Can also connect and list in one call:
138
141
  browser_list_tabs(browserURL="http://127.0.0.1:9222")`,
139
142
  inputSchema: {
140
143
  type: 'object',
@@ -148,14 +151,14 @@ browser_list_tabs(browserURL="http://127.0.0.1:9222")`,
148
151
  },
149
152
  {
150
153
  name: 'browser_select_tab',
151
- description: `Switch the active tab/page by index or URL/title pattern.
152
-
153
- After browser_list_tabs, use this to activate a specific tab.
154
- All subsequent page_* tools will operate on the selected tab.
155
-
156
- Examples:
157
- - browser_select_tab(index=0) -> first tab
158
- - browser_select_tab(urlPattern="qwen") -> tab whose URL contains "qwen"
154
+ description: `Switch the active tab/page by index or URL/title pattern.
155
+
156
+ After browser_list_tabs, use this to activate a specific tab.
157
+ All subsequent page_* tools will operate on the selected tab.
158
+
159
+ Examples:
160
+ - browser_select_tab(index=0) -> first tab
161
+ - browser_select_tab(urlPattern="qwen") -> tab whose URL contains "qwen"
159
162
  - browser_select_tab(titlePattern="Mini Program") -> tab whose title contains "Mini Program"`,
160
163
  inputSchema: {
161
164
  type: 'object',
@@ -75,7 +75,6 @@ export async function handleCamoufoxNavigateFlow(context, args) {
75
75
  text: JSON.stringify({
76
76
  success: true,
77
77
  driver: 'camoufox',
78
- captcha_detected: false,
79
78
  url: page.url(),
80
79
  title: await page.title(),
81
80
  }, null, 2),
@@ -1,3 +1,3 @@
1
1
  import type { CodeCollector } from '../../../domains/shared/modules.js';
2
2
  export declare function handleCaptchaVisionSolve(args: Record<string, unknown>, collector: CodeCollector): Promise<unknown>;
3
- export declare function handleTurnstileSolve(args: Record<string, unknown>, collector: CodeCollector): Promise<unknown>;
3
+ export declare function handleWidgetChallengeSolve(args: Record<string, unknown>, collector: CodeCollector): Promise<unknown>;