test-wuying-agentbay-sdk 0.13.0-beta.20251212133706 → 0.13.0-beta.20251212140302
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/dist/index.cjs +5418 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +20 -17
- package/dist/index.d.ts +20 -17
- package/dist/index.mjs +5328 -60
- package/dist/index.mjs.map +1 -1
- package/docs/api/browser-use/browser-agent.md +77 -22
- package/docs/examples/browser-use/browser/basic-usage.ts +31 -24
- package/docs/examples/browser-use/browser/run-2048.ts +47 -37
- package/docs/examples/browser-use/browser/run-sudoku.ts +55 -36
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as $dara from '@darabonba/typescript';
|
|
2
2
|
import OpenApi, { $OpenApiUtil } from '@alicloud/openapi-core';
|
|
3
|
+
import { ZodTypeAny, z } from 'zod';
|
|
3
4
|
|
|
4
5
|
interface Config {
|
|
5
6
|
endpoint: string;
|
|
@@ -3400,32 +3401,28 @@ declare class Agent {
|
|
|
3400
3401
|
|
|
3401
3402
|
interface ActOptions {
|
|
3402
3403
|
action: string;
|
|
3403
|
-
|
|
3404
|
-
iframes?: boolean;
|
|
3405
|
-
domSettleTimeoutMS?: number;
|
|
3404
|
+
timeout?: number;
|
|
3406
3405
|
variables?: Record<string, string>;
|
|
3407
3406
|
use_vision?: boolean;
|
|
3408
3407
|
}
|
|
3409
3408
|
interface ObserveOptions {
|
|
3410
3409
|
instruction: string;
|
|
3411
|
-
iframes?: boolean;
|
|
3412
|
-
domSettleTimeoutMS?: number;
|
|
3413
3410
|
use_vision?: boolean;
|
|
3411
|
+
selector?: string;
|
|
3412
|
+
timeout?: number;
|
|
3414
3413
|
}
|
|
3415
|
-
interface ExtractOptions<
|
|
3414
|
+
interface ExtractOptions<TSchema extends ZodTypeAny = ZodTypeAny> {
|
|
3416
3415
|
instruction: string;
|
|
3417
|
-
schema:
|
|
3416
|
+
schema: TSchema;
|
|
3418
3417
|
use_text_extract?: boolean;
|
|
3419
3418
|
selector?: string;
|
|
3420
|
-
iframe?: boolean;
|
|
3421
|
-
domSettleTimeoutMS?: number;
|
|
3422
3419
|
use_vision?: boolean;
|
|
3420
|
+
timeout?: number;
|
|
3423
3421
|
}
|
|
3424
3422
|
declare class ActResult {
|
|
3425
3423
|
success: boolean;
|
|
3426
3424
|
message: string;
|
|
3427
|
-
|
|
3428
|
-
constructor(success: boolean, message: string, action?: string);
|
|
3425
|
+
constructor(success: boolean, message: string);
|
|
3429
3426
|
}
|
|
3430
3427
|
declare class ObserveResult {
|
|
3431
3428
|
selector: string;
|
|
@@ -3438,15 +3435,21 @@ declare class BrowserAgent {
|
|
|
3438
3435
|
private session;
|
|
3439
3436
|
private browser;
|
|
3440
3437
|
constructor(session: Session, browser: Browser);
|
|
3438
|
+
/** ------------------ NAVIGATE ------------------ **/
|
|
3439
|
+
navigate(url: string): Promise<string>;
|
|
3440
|
+
/** ------------------ SCREENSHOT ------------------ **/
|
|
3441
|
+
screenshot(page?: any, full_page?: boolean, quality?: number, clip?: Record<string, number>, timeout?: number): Promise<string>;
|
|
3442
|
+
/** ------------------ CLOSE ------------------ **/
|
|
3443
|
+
close(): Promise<boolean>;
|
|
3441
3444
|
/** ------------------ ACT ------------------ **/
|
|
3442
|
-
act(options: ActOptions, page
|
|
3443
|
-
actAsync(options: ActOptions, page
|
|
3445
|
+
act(options: ActOptions, page?: any): Promise<ActResult>;
|
|
3446
|
+
actAsync(options: ActOptions, page?: any): Promise<ActResult>;
|
|
3444
3447
|
/** ------------------ OBSERVE ------------------ **/
|
|
3445
|
-
observe(options: ObserveOptions, page
|
|
3446
|
-
observeAsync(options: ObserveOptions, page
|
|
3448
|
+
observe(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
|
|
3449
|
+
observeAsync(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
|
|
3447
3450
|
/** ------------------ EXTRACT ------------------ **/
|
|
3448
|
-
extract<
|
|
3449
|
-
extractAsync<
|
|
3451
|
+
extract<TSchema extends ZodTypeAny>(options: ExtractOptions<TSchema>, page?: any): Promise<[boolean, z.infer<TSchema> | null]>;
|
|
3452
|
+
extractAsync<TSchema extends ZodTypeAny>(options: ExtractOptions<TSchema>, page?: any): Promise<[boolean, z.infer<TSchema> | null]>;
|
|
3450
3453
|
private _getPageAndContextIndexAsync;
|
|
3451
3454
|
private _callMcpTool;
|
|
3452
3455
|
private _delay;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as $dara from '@darabonba/typescript';
|
|
2
2
|
import OpenApi, { $OpenApiUtil } from '@alicloud/openapi-core';
|
|
3
|
+
import { ZodTypeAny, z } from 'zod';
|
|
3
4
|
|
|
4
5
|
interface Config {
|
|
5
6
|
endpoint: string;
|
|
@@ -3400,32 +3401,28 @@ declare class Agent {
|
|
|
3400
3401
|
|
|
3401
3402
|
interface ActOptions {
|
|
3402
3403
|
action: string;
|
|
3403
|
-
|
|
3404
|
-
iframes?: boolean;
|
|
3405
|
-
domSettleTimeoutMS?: number;
|
|
3404
|
+
timeout?: number;
|
|
3406
3405
|
variables?: Record<string, string>;
|
|
3407
3406
|
use_vision?: boolean;
|
|
3408
3407
|
}
|
|
3409
3408
|
interface ObserveOptions {
|
|
3410
3409
|
instruction: string;
|
|
3411
|
-
iframes?: boolean;
|
|
3412
|
-
domSettleTimeoutMS?: number;
|
|
3413
3410
|
use_vision?: boolean;
|
|
3411
|
+
selector?: string;
|
|
3412
|
+
timeout?: number;
|
|
3414
3413
|
}
|
|
3415
|
-
interface ExtractOptions<
|
|
3414
|
+
interface ExtractOptions<TSchema extends ZodTypeAny = ZodTypeAny> {
|
|
3416
3415
|
instruction: string;
|
|
3417
|
-
schema:
|
|
3416
|
+
schema: TSchema;
|
|
3418
3417
|
use_text_extract?: boolean;
|
|
3419
3418
|
selector?: string;
|
|
3420
|
-
iframe?: boolean;
|
|
3421
|
-
domSettleTimeoutMS?: number;
|
|
3422
3419
|
use_vision?: boolean;
|
|
3420
|
+
timeout?: number;
|
|
3423
3421
|
}
|
|
3424
3422
|
declare class ActResult {
|
|
3425
3423
|
success: boolean;
|
|
3426
3424
|
message: string;
|
|
3427
|
-
|
|
3428
|
-
constructor(success: boolean, message: string, action?: string);
|
|
3425
|
+
constructor(success: boolean, message: string);
|
|
3429
3426
|
}
|
|
3430
3427
|
declare class ObserveResult {
|
|
3431
3428
|
selector: string;
|
|
@@ -3438,15 +3435,21 @@ declare class BrowserAgent {
|
|
|
3438
3435
|
private session;
|
|
3439
3436
|
private browser;
|
|
3440
3437
|
constructor(session: Session, browser: Browser);
|
|
3438
|
+
/** ------------------ NAVIGATE ------------------ **/
|
|
3439
|
+
navigate(url: string): Promise<string>;
|
|
3440
|
+
/** ------------------ SCREENSHOT ------------------ **/
|
|
3441
|
+
screenshot(page?: any, full_page?: boolean, quality?: number, clip?: Record<string, number>, timeout?: number): Promise<string>;
|
|
3442
|
+
/** ------------------ CLOSE ------------------ **/
|
|
3443
|
+
close(): Promise<boolean>;
|
|
3441
3444
|
/** ------------------ ACT ------------------ **/
|
|
3442
|
-
act(options: ActOptions, page
|
|
3443
|
-
actAsync(options: ActOptions, page
|
|
3445
|
+
act(options: ActOptions, page?: any): Promise<ActResult>;
|
|
3446
|
+
actAsync(options: ActOptions, page?: any): Promise<ActResult>;
|
|
3444
3447
|
/** ------------------ OBSERVE ------------------ **/
|
|
3445
|
-
observe(options: ObserveOptions, page
|
|
3446
|
-
observeAsync(options: ObserveOptions, page
|
|
3448
|
+
observe(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
|
|
3449
|
+
observeAsync(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
|
|
3447
3450
|
/** ------------------ EXTRACT ------------------ **/
|
|
3448
|
-
extract<
|
|
3449
|
-
extractAsync<
|
|
3451
|
+
extract<TSchema extends ZodTypeAny>(options: ExtractOptions<TSchema>, page?: any): Promise<[boolean, z.infer<TSchema> | null]>;
|
|
3452
|
+
extractAsync<TSchema extends ZodTypeAny>(options: ExtractOptions<TSchema>, page?: any): Promise<[boolean, z.infer<TSchema> | null]>;
|
|
3450
3453
|
private _getPageAndContextIndexAsync;
|
|
3451
3454
|
private _callMcpTool;
|
|
3452
3455
|
private _delay;
|