@agentium/browser 3.1.0 → 3.1.2
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 +11 -1
- package/dist/action-space.d.ts +42 -0
- package/dist/action-space.d.ts.map +1 -0
- package/dist/browser-agent.d.ts +131 -0
- package/dist/browser-agent.d.ts.map +1 -0
- package/dist/browser-provider.d.ts +242 -0
- package/dist/browser-provider.d.ts.map +1 -0
- package/dist/credential-vault.d.ts +37 -0
- package/dist/credential-vault.d.ts.map +1 -0
- package/dist/index.cjs +512 -31
- package/dist/index.d.ts +7 -801
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +502 -31
- package/dist/loop-detector.d.ts +83 -0
- package/dist/loop-detector.d.ts.map +1 -0
- package/dist/prompts.d.ts +21 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/stealth.d.ts +27 -0
- package/dist/stealth.d.ts.map +1 -0
- package/dist/{index.d.cts → types.d.ts} +64 -387
- package/dist/types.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
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;
|
|
@@ -79,7 +41,31 @@ type BrowserAction = {
|
|
|
79
41
|
index?: number;
|
|
80
42
|
} | {
|
|
81
43
|
action: "navigate";
|
|
82
|
-
url: string;
|
|
44
|
+
url: string; /** Open the URL in a new tab, then switch to it. */
|
|
45
|
+
newTab?: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
action: "search";
|
|
48
|
+
query: string;
|
|
49
|
+
engine?: SearchEngine;
|
|
50
|
+
} | {
|
|
51
|
+
action: "new_tab";
|
|
52
|
+
url?: string;
|
|
53
|
+
} | {
|
|
54
|
+
action: "switch_tab";
|
|
55
|
+
tabId: string;
|
|
56
|
+
} | {
|
|
57
|
+
action: "close_tab";
|
|
58
|
+
tabId: string;
|
|
59
|
+
} | {
|
|
60
|
+
action: "search_page";
|
|
61
|
+
pattern: string;
|
|
62
|
+
regex?: boolean;
|
|
63
|
+
caseSensitive?: boolean;
|
|
64
|
+
maxResults?: number;
|
|
65
|
+
} | {
|
|
66
|
+
action: "find_elements";
|
|
67
|
+
selector: string;
|
|
68
|
+
maxResults?: number;
|
|
83
69
|
} | {
|
|
84
70
|
action: "back";
|
|
85
71
|
} | {
|
|
@@ -129,7 +115,7 @@ type BrowserAction = {
|
|
|
129
115
|
* One entry in the DOM snapshot the model sees. Returned by
|
|
130
116
|
* `BrowserProvider.extractDOM()` alongside the human-readable string form.
|
|
131
117
|
*/
|
|
132
|
-
interface DomElement {
|
|
118
|
+
export interface DomElement {
|
|
133
119
|
/** Stable 1-based index for this step. Used by indexed actions. */
|
|
134
120
|
index: number;
|
|
135
121
|
/** Center coordinate in CSS pixels (fallback for the model if needed). */
|
|
@@ -157,7 +143,7 @@ interface DomElement {
|
|
|
157
143
|
* model spatial awareness so it can decide when to scroll vs when more
|
|
158
144
|
* content is below / above the fold.
|
|
159
145
|
*/
|
|
160
|
-
interface DomScrollContext {
|
|
146
|
+
export interface DomScrollContext {
|
|
161
147
|
/** Approximate viewports of scrollable content above the current view. */
|
|
162
148
|
pagesAbove: number;
|
|
163
149
|
/** Approximate viewports of scrollable content below the current view. */
|
|
@@ -168,7 +154,7 @@ interface DomScrollContext {
|
|
|
168
154
|
hiddenInteractive: number;
|
|
169
155
|
}
|
|
170
156
|
/** Combined return value of `BrowserProvider.extractDOM()`. */
|
|
171
|
-
interface DomSnapshot {
|
|
157
|
+
export interface DomSnapshot {
|
|
172
158
|
/** Human-readable string fed to the model. */
|
|
173
159
|
text: string;
|
|
174
160
|
/** Structured list (stable indices) for runtime resolution. */
|
|
@@ -176,10 +162,32 @@ interface DomSnapshot {
|
|
|
176
162
|
/** Spatial/scroll context. */
|
|
177
163
|
scroll: DomScrollContext;
|
|
178
164
|
}
|
|
179
|
-
|
|
165
|
+
export type SearchEngine = "duckduckgo" | "google" | "bing";
|
|
166
|
+
export type BrowserPlanner = "vision" | "jev";
|
|
167
|
+
export interface BrowserAgentConfig {
|
|
180
168
|
name: string;
|
|
181
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* Vision-capable model (GPT-4o, Gemini, etc.).
|
|
171
|
+
* When `planner` is `"jev"`, this model is only used to invent type/search
|
|
172
|
+
* strings (unless `pageExtractionLLM` is set).
|
|
173
|
+
*/
|
|
182
174
|
model: ModelProvider;
|
|
175
|
+
/**
|
|
176
|
+
* Who picks the next action.
|
|
177
|
+
* - `"vision"` (default): the model writes JSON from screenshot + DOM.
|
|
178
|
+
* - `"jev"`: each step is a TypeSafe `choice` over this frame's controls
|
|
179
|
+
* (`click_12`, `back`, `done`, …). Needs `TYPESAFE_API_KEY`.
|
|
180
|
+
*/
|
|
181
|
+
planner?: BrowserPlanner;
|
|
182
|
+
/** Jev model id when `planner` is `"jev"`. Default: `jev-latest`. */
|
|
183
|
+
jevModel?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Max DOM elements offered as `click_N` / `type_N` choices (Jev or the
|
|
186
|
+
* observation list). Default: 40.
|
|
187
|
+
*/
|
|
188
|
+
maxActionChoices?: number;
|
|
189
|
+
/** Default engine for the `search` action. Default: `duckduckgo`. */
|
|
190
|
+
searchEngine?: SearchEngine;
|
|
183
191
|
/**
|
|
184
192
|
* Optional secondary (usually cheaper) model used for the `extract`
|
|
185
193
|
* action and other text-only sub-tasks. Falls back to `model`.
|
|
@@ -334,7 +342,7 @@ interface BrowserAgentConfig {
|
|
|
334
342
|
*/
|
|
335
343
|
memory?: UnifiedMemoryConfig;
|
|
336
344
|
/** Skills — pre-packaged or learned tool bundles. */
|
|
337
|
-
skills?: Array<
|
|
345
|
+
skills?: Array<import("@agentium/core").Skill | string>;
|
|
338
346
|
/**
|
|
339
347
|
* Custom tools that the BrowserAgent itself can invoke during a run.
|
|
340
348
|
* The agent emits `{ "action": "tool", "name": "<tool>", "args": {...} }`
|
|
@@ -348,7 +356,7 @@ interface BrowserAgentConfig {
|
|
|
348
356
|
logLevel?: LogLevel;
|
|
349
357
|
eventBus?: EventBus;
|
|
350
358
|
}
|
|
351
|
-
interface BrowserRunOpts {
|
|
359
|
+
export interface BrowserRunOpts {
|
|
352
360
|
/** Override startUrl from config */
|
|
353
361
|
startUrl?: string;
|
|
354
362
|
/** Per-run model API key override */
|
|
@@ -362,7 +370,7 @@ interface BrowserRunOpts {
|
|
|
362
370
|
/** Per-run override of `maxSteps`. */
|
|
363
371
|
maxSteps?: number;
|
|
364
372
|
}
|
|
365
|
-
interface BrowserRunOutput {
|
|
373
|
+
export interface BrowserRunOutput {
|
|
366
374
|
/** Final text result produced by the agent */
|
|
367
375
|
result: string;
|
|
368
376
|
/** Whether the task completed successfully (vs maxSteps exhausted or fail) */
|
|
@@ -380,7 +388,7 @@ interface BrowserRunOutput {
|
|
|
380
388
|
/** Extracted content from every `extract` action, in chronological order. */
|
|
381
389
|
extractedContent?: string[];
|
|
382
390
|
}
|
|
383
|
-
interface BrowserStep {
|
|
391
|
+
export interface BrowserStep {
|
|
384
392
|
index: number;
|
|
385
393
|
action: BrowserAction;
|
|
386
394
|
/** Screenshot taken before this action was executed. May be empty if useVision=false. */
|
|
@@ -408,14 +416,14 @@ interface BrowserStep {
|
|
|
408
416
|
* by browser-use's `AgentOutput`. Every field is optional from a runtime
|
|
409
417
|
* standpoint — only `action` is required for execution.
|
|
410
418
|
*/
|
|
411
|
-
interface AgentOutput {
|
|
419
|
+
export interface AgentOutput {
|
|
412
420
|
thinking?: string;
|
|
413
421
|
evaluationPreviousGoal?: string;
|
|
414
422
|
memory?: string;
|
|
415
423
|
nextGoal?: string;
|
|
416
424
|
action: BrowserAction | BrowserAction[];
|
|
417
425
|
}
|
|
418
|
-
interface StealthConfig {
|
|
426
|
+
export interface StealthConfig {
|
|
419
427
|
/**
|
|
420
428
|
* Remove `navigator.webdriver` flag and patch common detection vectors
|
|
421
429
|
* (plugins, languages, permissions, WebGL, etc.). Default when stealth=true.
|
|
@@ -449,7 +457,7 @@ interface StealthConfig {
|
|
|
449
457
|
password?: string;
|
|
450
458
|
};
|
|
451
459
|
}
|
|
452
|
-
interface HumanizeConfig {
|
|
460
|
+
export interface HumanizeConfig {
|
|
453
461
|
/** Per-character typing delay range in ms. Default: [40, 120] */
|
|
454
462
|
typingDelay?: [number, number];
|
|
455
463
|
/** Random pixel offset added to click coordinates. Default: 3 */
|
|
@@ -459,7 +467,7 @@ interface HumanizeConfig {
|
|
|
459
467
|
/** Simulate human-like mouse movement to target before clicking. Default: true */
|
|
460
468
|
mouseMovement?: boolean;
|
|
461
469
|
}
|
|
462
|
-
interface PageInfo {
|
|
470
|
+
export interface PageInfo {
|
|
463
471
|
url: string;
|
|
464
472
|
title: string;
|
|
465
473
|
viewportSize: {
|
|
@@ -467,335 +475,4 @@ interface PageInfo {
|
|
|
467
475
|
height: number;
|
|
468
476
|
};
|
|
469
477
|
}
|
|
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 };
|
|
478
|
+
//# 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,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GACrB;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACD;IACE,MAAM,EAAE,QAAQ,CAA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E,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE;AAED,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAID,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentium/browser",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Browser automation agent for Agentium using Playwright",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "tsup src/index.ts --format esm,cjs --
|
|
39
|
-
"dev": "tsup src/index.ts --format esm,cjs --
|
|
38
|
+
"build": "tsup src/index.ts --format esm,cjs --shims --clean && tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --pretty false",
|
|
39
|
+
"dev": "tsup src/index.ts --format esm,cjs --shims --watch",
|
|
40
40
|
"prepublishOnly": "npm run build"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript": "^5.6.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@agentium/core": "^3.1.
|
|
52
|
+
"@agentium/core": "^3.1.2",
|
|
53
53
|
"playwright": ">=1.40.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|