leapfrog-mcp 0.6.2 → 0.6.4

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 (58) hide show
  1. package/dist/adaptive-wait.d.ts +72 -0
  2. package/dist/adaptive-wait.js +695 -0
  3. package/dist/api-intelligence.d.ts +82 -0
  4. package/dist/api-intelligence.js +575 -0
  5. package/dist/captcha-solver.d.ts +26 -0
  6. package/dist/captcha-solver.js +547 -0
  7. package/dist/cdp-connector.d.ts +33 -0
  8. package/dist/cdp-connector.js +176 -0
  9. package/dist/consent-dismiss.d.ts +33 -0
  10. package/dist/consent-dismiss.js +358 -0
  11. package/dist/crash-recovery.d.ts +74 -0
  12. package/dist/crash-recovery.js +242 -0
  13. package/dist/domain-knowledge.d.ts +149 -0
  14. package/dist/domain-knowledge.js +449 -0
  15. package/dist/harness-intelligence.d.ts +65 -0
  16. package/dist/harness-intelligence.js +432 -0
  17. package/dist/humanize-fingerprint.d.ts +42 -0
  18. package/dist/humanize-fingerprint.js +161 -0
  19. package/dist/humanize-mouse.d.ts +95 -0
  20. package/dist/humanize-mouse.js +275 -0
  21. package/dist/humanize-pause.d.ts +48 -0
  22. package/dist/humanize-pause.js +111 -0
  23. package/dist/humanize-scroll.d.ts +67 -0
  24. package/dist/humanize-scroll.js +185 -0
  25. package/dist/humanize-typing.d.ts +60 -0
  26. package/dist/humanize-typing.js +258 -0
  27. package/dist/humanize-utils.d.ts +62 -0
  28. package/dist/humanize-utils.js +100 -0
  29. package/dist/index.js +3 -1
  30. package/dist/intervention.d.ts +65 -0
  31. package/dist/intervention.js +591 -0
  32. package/dist/logger.d.ts +13 -0
  33. package/dist/logger.js +47 -0
  34. package/dist/network-intelligence.d.ts +70 -0
  35. package/dist/network-intelligence.js +424 -0
  36. package/dist/page-classifier.d.ts +33 -0
  37. package/dist/page-classifier.js +1000 -0
  38. package/dist/paginate.d.ts +42 -0
  39. package/dist/paginate.js +693 -0
  40. package/dist/recording.d.ts +72 -0
  41. package/dist/recording.js +934 -0
  42. package/dist/script-executor.d.ts +31 -0
  43. package/dist/script-executor.js +249 -0
  44. package/dist/session-hud.d.ts +20 -0
  45. package/dist/session-hud.js +134 -0
  46. package/dist/snapshot-differ.d.ts +26 -0
  47. package/dist/snapshot-differ.js +225 -0
  48. package/dist/ssrf.d.ts +28 -0
  49. package/dist/ssrf.js +290 -0
  50. package/dist/stealth-audit.d.ts +27 -0
  51. package/dist/stealth-audit.js +719 -0
  52. package/dist/stealth.d.ts +195 -0
  53. package/dist/stealth.js +1157 -0
  54. package/dist/tab-manager.d.ts +14 -0
  55. package/dist/tab-manager.js +306 -0
  56. package/dist/tiles-coordinator.d.ts +106 -0
  57. package/dist/tiles-coordinator.js +358 -0
  58. package/package.json +1 -1
@@ -0,0 +1,72 @@
1
+ import type { Page } from "playwright-core";
2
+ import type { Session, SnapshotResult } from "./types.js";
3
+ import { type ClassificationResult } from "./page-classifier.js";
4
+ import type { SessionManager } from "./session-manager.js";
5
+ type WaitStrategy = "load" | "domcontentloaded" | "networkidle";
6
+ export interface AdaptiveNavigateOptions {
7
+ /** Wait strategy to start with. Default: "load" */
8
+ waitUntil?: WaitStrategy;
9
+ /** Enable auto-retry stealth escalation. Default: true */
10
+ autoRetry?: boolean;
11
+ /** Max escalation level (0-5). Default: 3 */
12
+ maxRetryLevel?: number;
13
+ /** Stealth mode override from bandit selection. Applied per-page via stealth.applyToPage(). */
14
+ stealthModeOverride?: 'off' | 'passive' | 'active';
15
+ /** Bandit arm index for this navigation (passed through for outcome tracking). */
16
+ banditArmIndex?: number;
17
+ }
18
+ export type PageQuality = "GOOD" | "EMPTY" | "TIMEOUT" | "BLOCKED";
19
+ export interface AdaptiveNavigateResult {
20
+ /** The snapshot result from the best attempt */
21
+ snapshot: SnapshotResult;
22
+ /** Page classification */
23
+ classification: ClassificationResult;
24
+ /** Final page URL after navigation */
25
+ url: string;
26
+ /** Page title */
27
+ title: string;
28
+ /** The page quality assessment */
29
+ quality: PageQuality;
30
+ /** Which waitUntil strategy succeeded */
31
+ finalStrategy: WaitStrategy;
32
+ /** Escalation metadata if stealth retries were used */
33
+ escalation?: EscalationMeta;
34
+ /** Bandit arm index used for this navigation (for outcome tracking) */
35
+ banditArmIndex?: number;
36
+ /** Stealth mode override applied by the bandit */
37
+ stealthModeOverride?: string;
38
+ /** The session that owns the page (may change if session was rotated) */
39
+ session: Session;
40
+ /** The page instance (may change if session was rotated) */
41
+ page: Page;
42
+ }
43
+ export interface EscalationMeta {
44
+ /** Level at which navigation succeeded (0-5) */
45
+ level: number;
46
+ /** Human-readable label for the level */
47
+ label: string;
48
+ /** Total retries attempted */
49
+ attempts: number;
50
+ /** Whether the session was rotated (Level 3+) */
51
+ sessionRotated: boolean;
52
+ /** New session ID if rotated */
53
+ newSessionId?: string;
54
+ }
55
+ /**
56
+ * Adaptive navigate: replaces the naive page.goto() in the navigate tool.
57
+ *
58
+ * 1. Tries the requested waitUntil strategy
59
+ * 2. Evaluates page quality (snapshot + classification)
60
+ * 3. Retries with alternative strategies if EMPTY/TIMEOUT
61
+ * 4. Escalates with stealth retries if BLOCKED/CHALLENGE
62
+ *
63
+ * Returns a rich result with snapshot, classification, escalation metadata,
64
+ * and the final session/page (which may differ if session was rotated).
65
+ */
66
+ export declare function adaptiveNavigate(page: Page, session: Session, url: string, sessionManager: SessionManager, options?: AdaptiveNavigateOptions): Promise<AdaptiveNavigateResult>;
67
+ /**
68
+ * Format the AdaptiveNavigateResult into the text output for the MCP tool response.
69
+ * Matches the existing navigate output format with optional escalation metadata.
70
+ */
71
+ export declare function formatAdaptiveResult(result: AdaptiveNavigateResult): string;
72
+ export {};