@agentium/browser 3.1.0 → 3.1.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,YAAY,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,GACd,MAAM,YAAY,CAAC"}
@@ -0,0 +1,83 @@
1
+ import type { BrowserAction } from "./types.js";
2
+ /**
3
+ * Detects two kinds of "stuck":
4
+ *
5
+ * 1. **Action loops** — the same action (after normalization) repeated too
6
+ * often in a rolling window. Replaces the v2.0.x exact-string compare
7
+ * that was easily fooled by tiny wording changes in `description`.
8
+ * 2. **Page stagnation** — the page hasn't changed (URL + interactive-
9
+ * element count + DOM text hash) for several steps in a row. Useful
10
+ * for catching cases where the agent keeps clicking but nothing
11
+ * happens (overlay blocking, dead button).
12
+ *
13
+ * Instead of hard-failing on the first sign of trouble like v2.0.x did,
14
+ * we emit a graduated severity level so the agent loop can:
15
+ * - 0/`none` — fine, do nothing
16
+ * - 1/`warn` — nudge the model ("you might be repeating yourself")
17
+ * - 2/`escalate` — stronger nudge ("you're definitely stuck, try a
18
+ * different approach")
19
+ * - 3/`abort` — force termination
20
+ *
21
+ * Thresholds are loosely modelled on browser-use's escalating nudges.
22
+ */
23
+ export type LoopSeverity = "none" | "warn" | "escalate" | "abort";
24
+ export interface LoopAdvice {
25
+ severity: LoopSeverity;
26
+ message?: string;
27
+ }
28
+ export interface PageFingerprint {
29
+ url: string;
30
+ interactiveCount: number;
31
+ /** Cheap hash of the first ~1000 chars of visible body text. */
32
+ textHash: number;
33
+ }
34
+ export declare class LoopDetector {
35
+ private actionWindow;
36
+ private pageHistory;
37
+ private readonly actionWindowSize;
38
+ private readonly pageHistorySize;
39
+ /** Thresholds: repeat counts at which each severity fires. */
40
+ private readonly actionThresholds;
41
+ /** Thresholds: consecutive unchanged-page counts at which each fires. */
42
+ private readonly pageThresholds;
43
+ constructor(opts?: {
44
+ actionWindowSize?: number;
45
+ pageHistorySize?: number;
46
+ actionThresholds?: {
47
+ warn?: number;
48
+ escalate?: number;
49
+ abort?: number;
50
+ };
51
+ pageThresholds?: {
52
+ warn?: number;
53
+ escalate?: number;
54
+ abort?: number;
55
+ };
56
+ });
57
+ /**
58
+ * Record an action and return advice for the runtime. `severity` of
59
+ * `abort` means the loop should terminate now.
60
+ */
61
+ recordAction(action: BrowserAction): LoopAdvice;
62
+ /**
63
+ * Record a page fingerprint and return advice if the page has been
64
+ * stagnant. Counts consecutive identical fingerprints at the END of
65
+ * the history (so a single navigation resets the counter).
66
+ */
67
+ recordPage(fp: PageFingerprint): LoopAdvice;
68
+ /** Combine two advices, returning the more severe one. */
69
+ static combine(a: LoopAdvice, b: LoopAdvice): LoopAdvice;
70
+ }
71
+ /**
72
+ * Normalize an action for loop comparison. The goal is to canonicalize
73
+ * tiny variations the LLM produces (e.g. different `description`s for
74
+ * the same click) into a single key while keeping actions that are
75
+ * fundamentally different (different `index`, `text`, `url`, …) distinct.
76
+ */
77
+ export declare function normalizeAction(action: BrowserAction): string;
78
+ /**
79
+ * Tiny non-cryptographic string hash, stable across runs. Used for the
80
+ * DOM-text portion of `PageFingerprint`.
81
+ */
82
+ export declare function fnvHash(s: string): number;
83
+ //# sourceMappingURL=loop-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loop-detector.d.ts","sourceRoot":"","sources":["../src/loop-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,E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AAO,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU;CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CA8C7D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAOzC"}
@@ -0,0 +1,20 @@
1
+ import type { ToolDef } from "@agentium/core";
2
+ import type { DomScrollContext } from "./types.js";
3
+ export declare function buildSystemPrompt(viewport: {
4
+ width: number;
5
+ height: number;
6
+ }, extraInstructions?: string, credentialKeys?: string[], options?: {
7
+ overrideSystemMessage?: string;
8
+ maxActionsPerStep?: number;
9
+ allowEvaluate?: boolean;
10
+ tools?: ToolDef[];
11
+ useVision?: boolean | "auto";
12
+ useDOM?: boolean;
13
+ useThinking?: boolean;
14
+ }): string;
15
+ export declare function buildUserMessage(task: string, pageUrl: string, pageTitle: string, stepIndex: number, actionHistory: string[], domSnapshot?: string, lastExtract?: string, scroll?: DomScrollContext, nudge?: string, stepBudget?: {
16
+ current: number;
17
+ max: number;
18
+ }): string;
19
+ export declare function summarizeAction(action: Record<string, unknown>): string;
20
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3C,iBAAiB,CAAC,EAAE,MAAM,EAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,EACzB,OAAO,CAAC,EAAE;IACR,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACA,MAAM,CAiIR;AA6CD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EAAE,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,gBAAgB,EACzB,KAAK,CAAC,EAAE,MAAM,EACd,UAAU,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5C,MAAM,CA0DR;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CA4CvE"}
@@ -0,0 +1,27 @@
1
+ import type { StealthConfig } from "./types.js";
2
+ /** Pick a random realistic user-agent string. */
3
+ export declare function pickUserAgent(): string;
4
+ /**
5
+ * JavaScript that runs inside every page to patch common bot-detection vectors.
6
+ * Injected via Playwright's `context.addInitScript()`.
7
+ */
8
+ export declare function getStealthScript(): string;
9
+ /**
10
+ * Build Playwright context options from a StealthConfig.
11
+ */
12
+ export declare function buildStealthContextOpts(config: StealthConfig, viewport: {
13
+ width: number;
14
+ height: number;
15
+ }): Record<string, unknown>;
16
+ /**
17
+ * Build Playwright launch options for stealth.
18
+ */
19
+ export declare function buildStealthLaunchArgs(config: StealthConfig): {
20
+ args: string[];
21
+ proxy?: {
22
+ server: string;
23
+ username?: string;
24
+ password?: string;
25
+ };
26
+ };
27
+ //# sourceMappingURL=stealth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stealth.d.ts","sourceRoot":"","sources":["../src/stealth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAWhD,iDAAiD;AACjD,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAoGzC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBzB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG;IAC7D,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE,CAcA"}
@@ -1,43 +1,5 @@
1
- import * as _agentium_core from '@agentium/core';
2
- import { ModelProvider, UnifiedMemoryConfig, ToolDef, CostTracker, LogLevel, EventBus, MemoryManager } from '@agentium/core';
3
-
4
- /**
5
- * Secure credential store for BrowserAgent.
6
- *
7
- * Secrets are stored in memory and NEVER sent to the LLM.
8
- * The model works with placeholders (e.g. `{{email}}`, `{{password}}`),
9
- * and the agent resolves them to real values only at execution time.
10
- */
11
- declare class CredentialVault {
12
- private secrets;
13
- constructor(initial?: Record<string, string>);
14
- /** Store a credential. Key names become the placeholder: `{{key}}`. */
15
- set(key: string, value: string): this;
16
- /** Retrieve a credential value. Returns undefined if not found. */
17
- get(key: string): string | undefined;
18
- has(key: string): boolean;
19
- /** List available placeholder names (never exposes values). */
20
- keys(): string[];
21
- /**
22
- * Load credentials from environment variables.
23
- * Maps env var names to placeholder keys.
24
- *
25
- * @example
26
- * vault.fromEnv({ email: "LOGIN_EMAIL", password: "LOGIN_PASS" });
27
- */
28
- fromEnv(mapping: Record<string, string>): this;
29
- /**
30
- * Replace `{{key}}` placeholders in text with actual credential values.
31
- * Used internally by BrowserAgent right before executing a type action.
32
- */
33
- resolve(text: string): string;
34
- /**
35
- * Replace any occurrence of real credential values in text with
36
- * their `{{key}}` placeholder. Used to sanitize logs and action history.
37
- */
38
- mask(text: string): string;
39
- }
40
-
1
+ import type { CostTracker, EventBus, LogLevel, ModelProvider, ToolDef, UnifiedMemoryConfig } from "@agentium/core";
2
+ import type { CredentialVault } from "./credential-vault.js";
41
3
  /**
42
4
  * The complete set of actions a `BrowserAgent` can take during a run.
43
5
  *
@@ -47,7 +9,7 @@ declare class CredentialVault {
47
9
  * they survive layout shifts, devicePixelRatio mismatches, and "the
48
10
  * sibling 4 pixels away" failure modes.
49
11
  */
50
- type BrowserAction = {
12
+ export type BrowserAction = {
51
13
  action: "click";
52
14
  /** Element index from the DOM snapshot. Preferred. */
53
15
  index?: number;
@@ -129,7 +91,7 @@ type BrowserAction = {
129
91
  * One entry in the DOM snapshot the model sees. Returned by
130
92
  * `BrowserProvider.extractDOM()` alongside the human-readable string form.
131
93
  */
132
- interface DomElement {
94
+ export interface DomElement {
133
95
  /** Stable 1-based index for this step. Used by indexed actions. */
134
96
  index: number;
135
97
  /** Center coordinate in CSS pixels (fallback for the model if needed). */
@@ -157,7 +119,7 @@ interface DomElement {
157
119
  * model spatial awareness so it can decide when to scroll vs when more
158
120
  * content is below / above the fold.
159
121
  */
160
- interface DomScrollContext {
122
+ export interface DomScrollContext {
161
123
  /** Approximate viewports of scrollable content above the current view. */
162
124
  pagesAbove: number;
163
125
  /** Approximate viewports of scrollable content below the current view. */
@@ -168,7 +130,7 @@ interface DomScrollContext {
168
130
  hiddenInteractive: number;
169
131
  }
170
132
  /** Combined return value of `BrowserProvider.extractDOM()`. */
171
- interface DomSnapshot {
133
+ export interface DomSnapshot {
172
134
  /** Human-readable string fed to the model. */
173
135
  text: string;
174
136
  /** Structured list (stable indices) for runtime resolution. */
@@ -176,7 +138,7 @@ interface DomSnapshot {
176
138
  /** Spatial/scroll context. */
177
139
  scroll: DomScrollContext;
178
140
  }
179
- interface BrowserAgentConfig {
141
+ export interface BrowserAgentConfig {
180
142
  name: string;
181
143
  /** Vision-capable model (GPT-4o, Gemini, etc.) */
182
144
  model: ModelProvider;
@@ -334,7 +296,7 @@ interface BrowserAgentConfig {
334
296
  */
335
297
  memory?: UnifiedMemoryConfig;
336
298
  /** Skills — pre-packaged or learned tool bundles. */
337
- skills?: Array<_agentium_core.Skill | string>;
299
+ skills?: Array<import("@agentium/core").Skill | string>;
338
300
  /**
339
301
  * Custom tools that the BrowserAgent itself can invoke during a run.
340
302
  * The agent emits `{ "action": "tool", "name": "<tool>", "args": {...} }`
@@ -348,7 +310,7 @@ interface BrowserAgentConfig {
348
310
  logLevel?: LogLevel;
349
311
  eventBus?: EventBus;
350
312
  }
351
- interface BrowserRunOpts {
313
+ export interface BrowserRunOpts {
352
314
  /** Override startUrl from config */
353
315
  startUrl?: string;
354
316
  /** Per-run model API key override */
@@ -362,7 +324,7 @@ interface BrowserRunOpts {
362
324
  /** Per-run override of `maxSteps`. */
363
325
  maxSteps?: number;
364
326
  }
365
- interface BrowserRunOutput {
327
+ export interface BrowserRunOutput {
366
328
  /** Final text result produced by the agent */
367
329
  result: string;
368
330
  /** Whether the task completed successfully (vs maxSteps exhausted or fail) */
@@ -380,7 +342,7 @@ interface BrowserRunOutput {
380
342
  /** Extracted content from every `extract` action, in chronological order. */
381
343
  extractedContent?: string[];
382
344
  }
383
- interface BrowserStep {
345
+ export interface BrowserStep {
384
346
  index: number;
385
347
  action: BrowserAction;
386
348
  /** Screenshot taken before this action was executed. May be empty if useVision=false. */
@@ -408,14 +370,14 @@ interface BrowserStep {
408
370
  * by browser-use's `AgentOutput`. Every field is optional from a runtime
409
371
  * standpoint — only `action` is required for execution.
410
372
  */
411
- interface AgentOutput {
373
+ export interface AgentOutput {
412
374
  thinking?: string;
413
375
  evaluationPreviousGoal?: string;
414
376
  memory?: string;
415
377
  nextGoal?: string;
416
378
  action: BrowserAction | BrowserAction[];
417
379
  }
418
- interface StealthConfig {
380
+ export interface StealthConfig {
419
381
  /**
420
382
  * Remove `navigator.webdriver` flag and patch common detection vectors
421
383
  * (plugins, languages, permissions, WebGL, etc.). Default when stealth=true.
@@ -449,7 +411,7 @@ interface StealthConfig {
449
411
  password?: string;
450
412
  };
451
413
  }
452
- interface HumanizeConfig {
414
+ export interface HumanizeConfig {
453
415
  /** Per-character typing delay range in ms. Default: [40, 120] */
454
416
  typingDelay?: [number, number];
455
417
  /** Random pixel offset added to click coordinates. Default: 3 */
@@ -459,7 +421,7 @@ interface HumanizeConfig {
459
421
  /** Simulate human-like mouse movement to target before clicking. Default: true */
460
422
  mouseMovement?: boolean;
461
423
  }
462
- interface PageInfo {
424
+ export interface PageInfo {
463
425
  url: string;
464
426
  title: string;
465
427
  viewportSize: {
@@ -467,335 +429,4 @@ interface PageInfo {
467
429
  height: number;
468
430
  };
469
431
  }
470
-
471
- declare class BrowserAgent {
472
- readonly name: string;
473
- readonly eventBus: EventBus;
474
- private model;
475
- private pageExtractionLLM;
476
- private fallbackModel;
477
- private useThinking;
478
- private historyWindow;
479
- private instructions?;
480
- private extendSystemMessage?;
481
- private overrideSystemMessage?;
482
- private maxSteps;
483
- private maxFailures;
484
- private maxActionsPerStep;
485
- private initialActions;
486
- private useVision;
487
- private directlyOpenUrl;
488
- private headless;
489
- private viewport;
490
- private defaultStartUrl?;
491
- private waitAfterAction;
492
- private maxRepeats;
493
- private useDOM;
494
- private allowEvaluate;
495
- private allowedDomains?;
496
- private prohibitedDomains?;
497
- private storageState?;
498
- private cdpUrl?;
499
- private recordVideo?;
500
- private credentials?;
501
- private stealth?;
502
- private humanize?;
503
- private tools;
504
- private costTracker;
505
- private memoryManager;
506
- private logger;
507
- /** Access the MemoryManager (if memory is configured). */
508
- get memory(): MemoryManager | null;
509
- constructor(config: BrowserAgentConfig);
510
- run(task: string, opts?: BrowserRunOpts): Promise<BrowserRunOutput>;
511
- /**
512
- * Returns a ToolDef that lets a regular Agent delegate browser tasks
513
- * to this BrowserAgent.
514
- */
515
- asTool(config?: {
516
- name?: string;
517
- description?: string;
518
- }): ToolDef;
519
- private shouldCaptureVision;
520
- private detectUrlInTask;
521
- private assertDomainAllowed;
522
- /**
523
- * Build the message array sent to the model: system prompt + a compact
524
- * summary of older turns (if any) + the most recent `historyWindow`
525
- * turns verbatim + the current step's user message.
526
- *
527
- * Inspired by browser-use's history compaction. Keeps tokens bounded
528
- * while giving the model meaningful context about what it already
529
- * tried.
530
- */
531
- private buildMessages;
532
- /**
533
- * Call the primary model, retrying once with `fallbackModel` on
534
- * transient errors (5xx, 429, network). Returns the response or
535
- * `null` if both models failed.
536
- */
537
- private callModelWithFallback;
538
- private isTransientError;
539
- /**
540
- * Parse the model's raw response into an `AgentOutput`. Tolerant to
541
- * three shapes:
542
- * - Full envelope: { thinking, evaluation_previous_goal, action, ... }
543
- * - Raw action object (legacy / `useThinking: false`)
544
- * - Raw action array
545
- *
546
- * Also strips ```json fences the model occasionally adds.
547
- */
548
- private parseEnvelope;
549
- /**
550
- * Quick post-navigation health check. If the page came back blank
551
- * (no body text and no interactive elements), reload once and wait
552
- * for stable. This catches the "FreightOS half-loaded font test" class
553
- * of failure before the LLM ever sees it.
554
- */
555
- private navigationHealthCheck;
556
- /**
557
- * Force-finalize the run with whatever partial data the agent has.
558
- * Called when:
559
- * - `maxSteps` is exhausted without an explicit `done`,
560
- * - `maxFailures` is exceeded,
561
- * - the model can't produce parseable JSON enough times to make
562
- * forward progress.
563
- * The result is composed from `extractedContent` + the last few
564
- * action summaries so the caller gets something useful instead of
565
- * just a one-line error.
566
- */
567
- private forceDone;
568
- private finalize;
569
- /**
570
- * Execute a single action. Returns `{ output?, didNavigate? }` for the
571
- * caller's state tracking. May throw — the loop handles failure-budget
572
- * accounting in that case.
573
- */
574
- private executeAction;
575
- private sleep;
576
- /**
577
- * Parse a quoted target keyword from a click action's `description`.
578
- * Returns `undefined` for generic / ambiguous labels (login buttons,
579
- * close, OK, etc.) where a substring text match could fire on the
580
- * wrong element.
581
- */
582
- private extractClickKeyword;
583
- }
584
-
585
- /**
586
- * Playwright wrapper with stealth anti-detection, human-like behavior,
587
- * indexed DOM element resolution, and a rich action vocabulary.
588
- *
589
- * The `BrowserProvider` is intentionally LLM-agnostic — it exposes the
590
- * primitives that `BrowserAgent` orchestrates via vision+DOM reasoning.
591
- */
592
- declare class BrowserProvider {
593
- private browser;
594
- private context;
595
- private page;
596
- private pages;
597
- private activeTabId;
598
- private tabCounter;
599
- private _viewport;
600
- private _videoDir?;
601
- private _humanize?;
602
- /**
603
- * Most recent DOM snapshot (one per `extractDOM` call). Indexed actions
604
- * (`clickByIndex`, `inputByIndex`, …) resolve their `index` against this.
605
- */
606
- private _lastDom;
607
- /** True if we connected over CDP (don't tear down the browser on close). */
608
- private _attached;
609
- constructor();
610
- launch(opts?: {
611
- headless?: boolean;
612
- viewport?: {
613
- width: number;
614
- height: number;
615
- };
616
- storageState?: string;
617
- recordVideo?: boolean | {
618
- dir: string;
619
- };
620
- stealth?: boolean | StealthConfig;
621
- humanize?: boolean | HumanizeConfig;
622
- cdpUrl?: string;
623
- }): Promise<void>;
624
- saveStorageState(path: string): Promise<void>;
625
- navigate(url: string): Promise<void>;
626
- back(): Promise<void>;
627
- screenshot(): Promise<Buffer>;
628
- /** Viewport size in CSS pixels (matches screenshot dimensions). */
629
- get viewport(): {
630
- width: number;
631
- height: number;
632
- };
633
- /** Most recent DOM snapshot. Each entry has a stable `index`. */
634
- get lastDom(): DomElement[];
635
- click(x: number, y: number): Promise<void>;
636
- type(text: string): Promise<void>;
637
- clickAndType(x: number, y: number, text: string): Promise<void>;
638
- pressKey(key: string): Promise<void>;
639
- /**
640
- * Send arbitrary keyboard keys / shortcuts. Accepts a single
641
- * Playwright key spec (`"Enter"`, `"Control+l"`, `"Shift+ArrowDown"`)
642
- * or a space-separated sequence (`"Tab Tab Enter"`).
643
- */
644
- sendKeys(keys: string): Promise<void>;
645
- scroll(direction: "up" | "down", amount?: number): Promise<void>;
646
- /**
647
- * Build a Playwright locator for a DOM-snapshot index. Each `extractDOM`
648
- * call tags surviving elements with `data-bua-idx="<n>"`; we resolve by
649
- * that attribute. Returns null if the index is unknown.
650
- */
651
- private locatorForIndex;
652
- /**
653
- * Click an element by its DOM-snapshot index. The most reliable click
654
- * path on dynamic pages — survives layout shifts and DPR oddities.
655
- */
656
- clickByIndex(index: number, opts?: {
657
- timeout?: number;
658
- }): Promise<boolean>;
659
- /**
660
- * Focus an indexed input, optionally clear it, and type. Returns false
661
- * if the index couldn't be resolved or the input couldn't be focused.
662
- */
663
- inputByIndex(index: number, text: string, opts?: {
664
- clear?: boolean;
665
- submit?: boolean;
666
- timeout?: number;
667
- }): Promise<boolean>;
668
- uploadFileByIndex(index: number, path: string): Promise<boolean>;
669
- /** Scroll the indexed element into view (no click). */
670
- scrollIntoViewByIndex(index: number): Promise<boolean>;
671
- /**
672
- * Deterministic, DOM-based click using Playwright's text locator.
673
- *
674
- * Returns `true` if a matching, visible, clickable element was found and
675
- * clicked within `timeout` ms; `false` otherwise (so the caller can fall
676
- * back to coordinate clicking). Substring-matches by default — e.g.
677
- * `clickByText("Cheapest")` matches "Cheapest · 23-28 days · $2,550".
678
- */
679
- clickByText(keyword: string, opts?: {
680
- timeout?: number;
681
- }): Promise<boolean>;
682
- /**
683
- * Scroll the first occurrence of `text` into view. Returns false if no
684
- * match was found within the timeout.
685
- */
686
- findText(text: string, opts?: {
687
- timeout?: number;
688
- }): Promise<boolean>;
689
- /**
690
- * Read the options of a native `<select>` at the given DOM-snapshot
691
- * index. Returns `[]` if the element is not a `<select>`.
692
- */
693
- dropdownOptions(index: number): Promise<{
694
- value: string;
695
- label: string;
696
- selected: boolean;
697
- }[]>;
698
- /**
699
- * Select an option in a native `<select>` by its visible text or value.
700
- * Returns false if the element isn't a `<select>` or no option matched.
701
- */
702
- selectDropdown(index: number, text: string): Promise<boolean>;
703
- /**
704
- * Run arbitrary JS in the page context. The caller is responsible for
705
- * gating this behind a config flag — the BrowserAgent only routes the
706
- * `evaluate` action here when `allowEvaluate: true`.
707
- *
708
- * The code is wrapped in `(async () => { ... })()` and the return value
709
- * is coerced to a string for the model.
710
- */
711
- evaluate(code: string): Promise<string>;
712
- /**
713
- * Returns a clean text representation of the visible page body, with
714
- * optional link extraction. Used by the BrowserAgent's `extract` action
715
- * — the text is passed to a (usually cheap) LLM with the user's query.
716
- */
717
- pageText(opts?: {
718
- extractLinks?: boolean;
719
- maxChars?: number;
720
- }): Promise<string>;
721
- /**
722
- * Snapshot the interactive elements visible in the viewport, tag each
723
- * with a `data-bua-idx="<n>"` attribute (used by indexed actions), and
724
- * return:
725
- * - `text`: a human-readable string fed to the model
726
- * - `elements`: the structured list with stable indices
727
- * - `scroll`: spatial context (pages above/below, hidden interactive count)
728
- *
729
- * Five properties matter for accuracy:
730
- * - **Hit-tested**: each listed coordinate / index actually reaches the
731
- * labeled element (overlays / occlusion skip the entry).
732
- * - **Visibility filtered (with parent chain)**: an element is dropped
733
- * if itself OR any ancestor is `display:none`, `visibility:hidden`,
734
- * `pointer-events:none`, or near-zero opacity.
735
- * - **Shadow DOM piercing**: traverses open shadow roots so custom
736
- * elements / web components are visible to the agent.
737
- * - **Same-origin iframes**: walks into each accessible iframe and
738
- * includes its interactive elements (offset by the iframe's screen
739
- * position so the coordinates the model sees are still viewport-
740
- * relative).
741
- * - **`cursor: pointer` fallback pass**: catches custom React widgets
742
- * that have no semantic role/href/onclick but are clickable.
743
- */
744
- extractDOM(opts?: {
745
- maxElements?: number;
746
- }): Promise<DomSnapshot>;
747
- /**
748
- * Install the `__buaExtract` global on the main page. Idempotent —
749
- * subsequent calls are no-ops.
750
- */
751
- private installExtractorScript;
752
- /**
753
- * The extractor source. Lives in its own method so we can also inject
754
- * it into iframes that haven't yet had it loaded.
755
- *
756
- * This function intentionally runs entirely in the page context. It:
757
- * - traverses the regular DOM + open shadow roots (deep)
758
- * - applies a parent-chain visibility filter
759
- * - applies a `cursor:pointer` second pass for custom widgets
760
- * - hit-tests each candidate at its center to avoid overlay collisions
761
- * - returns scroll context (pages above/below, hidden counts)
762
- * - tags survivors with `data-bua-idx` for indexed actions
763
- */
764
- private extractorScriptSource;
765
- getPageInfo(): Promise<PageInfo>;
766
- waitForStable(minWait?: number): Promise<void>;
767
- newTab(url?: string): Promise<string>;
768
- switchTab(tabId: string): Promise<void>;
769
- closeTab(tabId: string): Promise<void>;
770
- listTabs(): {
771
- id: string;
772
- url: string;
773
- active: boolean;
774
- }[];
775
- get currentTabId(): string;
776
- getVideoPath(tabId?: string): Promise<string | null>;
777
- get videoDir(): string | undefined;
778
- close(): Promise<void>;
779
- /** Add small random offset to coordinates to avoid pixel-perfect bot patterns. */
780
- private jitter;
781
- /**
782
- * Safety net: clamp coordinates returned by the vision model to the actual
783
- * viewport. If a model occasionally returns image-space coordinates from a
784
- * 2x screenshot (despite our `scale: "css"` fix), this prevents Playwright
785
- * from clicking at e.g. (2200, 1300) and either erroring or landing on a
786
- * random off-screen element.
787
- */
788
- private clampToViewport;
789
- /**
790
- * Simulate human mouse movement using smoothstep interpolation.
791
- */
792
- private humanMouseMove;
793
- /** Small random pause after an interaction. */
794
- private humanPause;
795
- private randInt;
796
- private ensurePage;
797
- private ensureContext;
798
- private sleep;
799
- }
800
-
801
- export { type AgentOutput, type BrowserAction, BrowserAgent, type BrowserAgentConfig, BrowserProvider, type BrowserRunOpts, type BrowserRunOutput, type BrowserStep, CredentialVault, type DomElement, type DomScrollContext, type DomSnapshot, type HumanizeConfig, type PageInfo, type StealthConfig };
432
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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