test-wuying-agentbay-sdk 0.13.0-beta.20251212133706 → 0.13.0-beta.20251212160413

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.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
- timeoutMS?: number;
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<T = any> {
3414
+ interface ExtractOptions<TSchema extends ZodTypeAny = ZodTypeAny> {
3416
3415
  instruction: string;
3417
- schema: new (...args: any[]) => T;
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
- action?: string;
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: any): Promise<ActResult>;
3443
- actAsync(options: ActOptions, page: any): Promise<ActResult>;
3445
+ act(options: ActOptions, page?: any): Promise<ActResult>;
3446
+ actAsync(options: ActOptions, page?: any): Promise<ActResult>;
3444
3447
  /** ------------------ OBSERVE ------------------ **/
3445
- observe(options: ObserveOptions, page: any): Promise<[boolean, ObserveResult[]]>;
3446
- observeAsync(options: ObserveOptions, page: any): Promise<[boolean, ObserveResult[]]>;
3448
+ observe(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
3449
+ observeAsync(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
3447
3450
  /** ------------------ EXTRACT ------------------ **/
3448
- extract<T>(options: ExtractOptions<T>, page: any): Promise<[boolean, T | null]>;
3449
- extractAsync<T>(options: ExtractOptions<T>, page: any): Promise<[boolean, T | null]>;
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;
@@ -6588,12 +6591,14 @@ interface CreateSessionParamsConfig {
6588
6591
  enableBrowserReplay?: boolean;
6589
6592
  /** Extra configuration settings for different session types (e.g., mobile) */
6590
6593
  extraConfigs?: ExtraConfigs;
6594
+ /** Framework name for SDK statistics tracking */
6595
+ framework?: string;
6591
6596
  }
6592
6597
  /**
6593
6598
  * CreateSessionParams provides a way to configure the parameters for creating a new session
6594
6599
  * in the AgentBay cloud environment.
6595
6600
  */
6596
- declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6601
+ declare class CreateSessionParams implements CreateSessionParamsConfig {
6597
6602
  /** Custom labels for the Session. These can be used for organizing and filtering sessions. */
6598
6603
  labels: Record<string, string>;
6599
6604
  /** Image ID to use for the session. */
@@ -6613,39 +6618,45 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6613
6618
  enableBrowserReplay: boolean;
6614
6619
  /** Extra configuration settings for different session types (e.g., mobile) */
6615
6620
  extraConfigs?: ExtraConfigs;
6621
+ /** Framework name for SDK statistics tracking */
6622
+ framework?: string;
6616
6623
  constructor();
6617
6624
  /**
6618
6625
  * WithLabels sets the labels for the session parameters and returns the updated parameters.
6619
6626
  */
6620
- withLabels(labels: Record<string, string>): CreateSessionParams$1;
6627
+ withLabels(labels: Record<string, string>): CreateSessionParams;
6621
6628
  /**
6622
6629
  * WithImageId sets the image ID for the session parameters and returns the updated parameters.
6623
6630
  */
6624
- withImageId(imageId: string): CreateSessionParams$1;
6631
+ withImageId(imageId: string): CreateSessionParams;
6625
6632
  /**
6626
6633
  * WithBrowserContext sets the browser context for the session parameters and returns the updated parameters.
6627
6634
  */
6628
- withBrowserContext(browserContext: BrowserContext): CreateSessionParams$1;
6635
+ withBrowserContext(browserContext: BrowserContext): CreateSessionParams;
6629
6636
  /**
6630
6637
  * WithIsVpc sets the VPC flag for the session parameters and returns the updated parameters.
6631
6638
  */
6632
- withIsVpc(isVpc: boolean): CreateSessionParams$1;
6639
+ withIsVpc(isVpc: boolean): CreateSessionParams;
6633
6640
  /**
6634
6641
  * WithPolicyId sets the policy id for the session parameters and returns the updated parameters.
6635
6642
  */
6636
- withPolicyId(policyId: string): CreateSessionParams$1;
6643
+ withPolicyId(policyId: string): CreateSessionParams;
6637
6644
  /**
6638
6645
  * WithenableBrowserReplay sets the browser recording flag for the session parameters and returns the updated parameters.
6639
6646
  */
6640
- withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams$1;
6647
+ withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams;
6641
6648
  /**
6642
6649
  * Alias for withEnableBrowserReplay for backward compatibility.
6643
6650
  */
6644
- withEnableRecord(enableRecord: boolean): CreateSessionParams$1;
6651
+ withEnableRecord(enableRecord: boolean): CreateSessionParams;
6645
6652
  /**
6646
6653
  * WithExtraConfigs sets the extra configurations for the session parameters and returns the updated parameters.
6647
6654
  */
6648
- withExtraConfigs(extraConfigs: ExtraConfigs): CreateSessionParams$1;
6655
+ withExtraConfigs(extraConfigs: ExtraConfigs): CreateSessionParams;
6656
+ /**
6657
+ * WithFramework sets the framework name for the session parameters and returns the updated parameters.
6658
+ */
6659
+ withFramework(framework: string): CreateSessionParams;
6649
6660
  /**
6650
6661
  * GetLabelsJSON returns the labels as a JSON string.
6651
6662
  * Returns an object with success status and result/error message to match Go version behavior.
@@ -6659,15 +6670,15 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6659
6670
  /**
6660
6671
  * AddContextSync adds a context sync configuration to the session parameters.
6661
6672
  */
6662
- addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams$1;
6673
+ addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams;
6663
6674
  /**
6664
6675
  * AddContextSyncConfig adds a pre-configured context sync to the session parameters.
6665
6676
  */
6666
- addContextSyncConfig(contextSync: ContextSync): CreateSessionParams$1;
6677
+ addContextSyncConfig(contextSync: ContextSync): CreateSessionParams;
6667
6678
  /**
6668
6679
  * WithContextSync sets the context sync configurations for the session parameters.
6669
6680
  */
6670
- withContextSync(contextSyncs: ContextSync[]): CreateSessionParams$1;
6681
+ withContextSync(contextSyncs: ContextSync[]): CreateSessionParams;
6671
6682
  /**
6672
6683
  * Convert to plain object for JSON serialization
6673
6684
  */
@@ -6675,12 +6686,12 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6675
6686
  /**
6676
6687
  * Create from plain object
6677
6688
  */
6678
- static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams$1;
6689
+ static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams;
6679
6690
  }
6680
6691
  /**
6681
6692
  * NewCreateSessionParams creates a new CreateSessionParams with default values.
6682
6693
  */
6683
- declare function newCreateSessionParams(): CreateSessionParams$1;
6694
+ declare function newCreateSessionParams(): CreateSessionParams;
6684
6695
 
6685
6696
  /**
6686
6697
  * Parameters for listing sessions with pagination support
@@ -6714,7 +6725,7 @@ declare function createListSessionParams(labels?: Record<string, string>): ListS
6714
6725
  /**
6715
6726
  * Parameters for creating a session.
6716
6727
  */
6717
- interface CreateSessionParams {
6728
+ interface CreateSeesionWithParams {
6718
6729
  labels?: Record<string, string>;
6719
6730
  imageId?: string;
6720
6731
  contextSync?: ContextSync[];
@@ -6730,7 +6741,7 @@ interface CreateSessionParams {
6730
6741
  */
6731
6742
  declare class AgentBay {
6732
6743
  private apiKey;
6733
- private client;
6744
+ client: Client;
6734
6745
  private endpoint;
6735
6746
  private fileTransferContext;
6736
6747
  private config;
@@ -6819,7 +6830,7 @@ declare class AgentBay {
6819
6830
  *
6820
6831
  * @see {@link get}, {@link list}, {@link Session.delete}
6821
6832
  */
6822
- create(params?: CreateSessionParams): Promise<SessionResult>;
6833
+ create(params: CreateSessionParams | CreateSeesionWithParams): Promise<SessionResult>;
6823
6834
  /**
6824
6835
  * Returns paginated list of session IDs filtered by labels.
6825
6836
  *
@@ -7280,4 +7291,4 @@ declare function logWarn(message: string, ...args: any[]): void;
7280
7291
  */
7281
7292
  declare function logError(message: string, error?: any): void;
7282
7293
 
7283
- export { APIError, APP_BLACKLIST_TEMPLATE, APP_WHITELIST_TEMPLATE, type ActOptions, ActResult, Agent, AgentBay, AgentBayError, type AgentOptions, type ApiResponse, type ApiResponseWithData, type AppManagerRule, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, type Brand, Browser, BrowserAgent, BrowserContext, BrowserError, type BrowserFingerprint, BrowserFingerprintContext, BrowserFingerprintGenerator, type BrowserOption, BrowserOptionClass, type BrowserProxy, BrowserProxyClass, type BrowserScreen, BrowserUseAgent, type BrowserViewport, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, ClearContextRequest, ClearContextResponse, ClearContextResponseBody, Client, Code, Command, Computer, ComputerUseAgent, type Config, Context, type ContextInfoResult, ContextManager, ContextService, type ContextStatusData, type ContextStatusItem, ContextSync, type ContextSyncResult, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, type CreateSessionParams, type CreateSessionParamsConfig, DeleteContextFileRequest, DeleteContextFileResponse, DeleteContextFileResponseBody, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, type DeleteResult, DescribeContextFilesRequest, DescribeContextFilesResponse, DescribeContextFilesResponseBody, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, type ExecutionResult, Extension, ExtensionOption, ExtensionsService, type ExtraConfigs, type ExtraProperties, type ExtractOptions, type ExtractPolicy, ExtractPolicyClass, type FileChangeEvent, FileChangeEventHelper, type FileChangeResult, FileChangeResultHelper, FileError, type FileInfo, FileSystem, type Fingerprint, FingerprintFormat, GetAdbLinkRequest, GetAdbLinkResponse, GetAdbLinkResponseBody, GetAdbLinkResponseBodyData, GetCdpLinkRequest, GetCdpLinkResponse, GetCdpLinkResponseBody, GetCdpLinkResponseBodyData, GetContextFileDownloadUrlRequest, GetContextFileDownloadUrlResponse, GetContextFileDownloadUrlResponseBody, GetContextFileUploadUrlRequest, GetContextFileUploadUrlResponse, GetContextFileUploadUrlResponseBody, GetContextInfoRequest, GetContextInfoResponse, GetContextInfoResponseBody, GetContextInfoResponseBodyData, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetLinkResponseBodyData, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, GetSessionRequest, GetSessionResponse, GetSessionResponseBody, GetSessionResponseBodyData, HIDE_NAVIGATION_BAR_TEMPLATE, IS_RELEASE, InitBrowserRequest, InitBrowserResponse, InitBrowserResponseBody, InitBrowserResponseBodyData, type InitializationResult, Lifecycle, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, type LogLevel, type LoggerConfig, MOBILE_COMMAND_TEMPLATES, type MappingPolicy, type McpSession, type McpToolResult, Mobile, type MobileExtraConfig, type MobileSimulateConfig, MobileSimulateMode, MobileSimulateService, type MobileSimulateUploadResult, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, type NavigatorFingerprint, type ObserveOptions, ObserveResult, Oss, OssError, PauseSessionAsyncRequest, PauseSessionAsyncResponse, PauseSessionAsyncResponseBody, type QueryResult, RESOLUTION_LOCK_TEMPLATE, type RecyclePolicy, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, ResumeSessionAsyncRequest, ResumeSessionAsyncResponse, ResumeSessionAsyncResponseBody, SHOW_NAVIGATION_BAR_TEMPLATE, type ScreenFingerprint, Session, SessionError, type SessionInterface, type SessionListResult, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, type SyncCallback, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, SyncPolicyImpl, UNINSTALL_BLACKLIST_TEMPLATE, UploadMode, type UploadPolicy, UploadStrategy, type UserAgentData, VERSION, type VideoCard, type WhiteList, WhiteListValidator, createListSessionParams, extraConfigsFromJSON, extraConfigsToJSON, extractRequestId, getLogLevel, getMobileCommandTemplate, hasMobileCommandTemplate, log, logDebug, logError, logInfo, logWarn, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newExtractPolicy, newMappingPolicy, newRecyclePolicy, newSyncPolicy, newSyncPolicyWithDefaults, newUploadPolicy, replaceTemplatePlaceholders, setLogLevel, setupLogger, validateAppManagerRule, validateExtraConfigs, validateMobileExtraConfig, validateMobileSimulateConfig };
7294
+ export { APIError, APP_BLACKLIST_TEMPLATE, APP_WHITELIST_TEMPLATE, type ActOptions, ActResult, Agent, AgentBay, AgentBayError, type AgentOptions, type ApiResponse, type ApiResponseWithData, type AppManagerRule, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, type Brand, Browser, BrowserAgent, BrowserContext, BrowserError, type BrowserFingerprint, BrowserFingerprintContext, BrowserFingerprintGenerator, type BrowserOption, BrowserOptionClass, type BrowserProxy, BrowserProxyClass, type BrowserScreen, BrowserUseAgent, type BrowserViewport, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, ClearContextRequest, ClearContextResponse, ClearContextResponseBody, Client, Code, Command, Computer, ComputerUseAgent, type Config, Context, type ContextInfoResult, ContextManager, ContextService, type ContextStatusData, type ContextStatusItem, ContextSync, type ContextSyncResult, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, CreateSessionParams, type CreateSessionParamsConfig, DeleteContextFileRequest, DeleteContextFileResponse, DeleteContextFileResponseBody, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, type DeleteResult, DescribeContextFilesRequest, DescribeContextFilesResponse, DescribeContextFilesResponseBody, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, type ExecutionResult, Extension, ExtensionOption, ExtensionsService, type ExtraConfigs, type ExtraProperties, type ExtractOptions, type ExtractPolicy, ExtractPolicyClass, type FileChangeEvent, FileChangeEventHelper, type FileChangeResult, FileChangeResultHelper, FileError, type FileInfo, FileSystem, type Fingerprint, FingerprintFormat, GetAdbLinkRequest, GetAdbLinkResponse, GetAdbLinkResponseBody, GetAdbLinkResponseBodyData, GetCdpLinkRequest, GetCdpLinkResponse, GetCdpLinkResponseBody, GetCdpLinkResponseBodyData, GetContextFileDownloadUrlRequest, GetContextFileDownloadUrlResponse, GetContextFileDownloadUrlResponseBody, GetContextFileUploadUrlRequest, GetContextFileUploadUrlResponse, GetContextFileUploadUrlResponseBody, GetContextInfoRequest, GetContextInfoResponse, GetContextInfoResponseBody, GetContextInfoResponseBodyData, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetLinkResponseBodyData, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, GetSessionRequest, GetSessionResponse, GetSessionResponseBody, GetSessionResponseBodyData, HIDE_NAVIGATION_BAR_TEMPLATE, IS_RELEASE, InitBrowserRequest, InitBrowserResponse, InitBrowserResponseBody, InitBrowserResponseBodyData, type InitializationResult, Lifecycle, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, type LogLevel, type LoggerConfig, MOBILE_COMMAND_TEMPLATES, type MappingPolicy, type McpSession, type McpToolResult, Mobile, type MobileExtraConfig, type MobileSimulateConfig, MobileSimulateMode, MobileSimulateService, type MobileSimulateUploadResult, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, type NavigatorFingerprint, type ObserveOptions, ObserveResult, Oss, OssError, PauseSessionAsyncRequest, PauseSessionAsyncResponse, PauseSessionAsyncResponseBody, type QueryResult, RESOLUTION_LOCK_TEMPLATE, type RecyclePolicy, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, ResumeSessionAsyncRequest, ResumeSessionAsyncResponse, ResumeSessionAsyncResponseBody, SHOW_NAVIGATION_BAR_TEMPLATE, type ScreenFingerprint, Session, SessionError, type SessionInterface, type SessionListResult, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, type SyncCallback, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, SyncPolicyImpl, UNINSTALL_BLACKLIST_TEMPLATE, UploadMode, type UploadPolicy, UploadStrategy, type UserAgentData, VERSION, type VideoCard, type WhiteList, WhiteListValidator, createListSessionParams, extraConfigsFromJSON, extraConfigsToJSON, extractRequestId, getLogLevel, getMobileCommandTemplate, hasMobileCommandTemplate, log, logDebug, logError, logInfo, logWarn, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newExtractPolicy, newMappingPolicy, newRecyclePolicy, newSyncPolicy, newSyncPolicyWithDefaults, newUploadPolicy, replaceTemplatePlaceholders, setLogLevel, setupLogger, validateAppManagerRule, validateExtraConfigs, validateMobileExtraConfig, validateMobileSimulateConfig };
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
- timeoutMS?: number;
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<T = any> {
3414
+ interface ExtractOptions<TSchema extends ZodTypeAny = ZodTypeAny> {
3416
3415
  instruction: string;
3417
- schema: new (...args: any[]) => T;
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
- action?: string;
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: any): Promise<ActResult>;
3443
- actAsync(options: ActOptions, page: any): Promise<ActResult>;
3445
+ act(options: ActOptions, page?: any): Promise<ActResult>;
3446
+ actAsync(options: ActOptions, page?: any): Promise<ActResult>;
3444
3447
  /** ------------------ OBSERVE ------------------ **/
3445
- observe(options: ObserveOptions, page: any): Promise<[boolean, ObserveResult[]]>;
3446
- observeAsync(options: ObserveOptions, page: any): Promise<[boolean, ObserveResult[]]>;
3448
+ observe(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
3449
+ observeAsync(options: ObserveOptions, page?: any): Promise<[boolean, ObserveResult[]]>;
3447
3450
  /** ------------------ EXTRACT ------------------ **/
3448
- extract<T>(options: ExtractOptions<T>, page: any): Promise<[boolean, T | null]>;
3449
- extractAsync<T>(options: ExtractOptions<T>, page: any): Promise<[boolean, T | null]>;
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;
@@ -6588,12 +6591,14 @@ interface CreateSessionParamsConfig {
6588
6591
  enableBrowserReplay?: boolean;
6589
6592
  /** Extra configuration settings for different session types (e.g., mobile) */
6590
6593
  extraConfigs?: ExtraConfigs;
6594
+ /** Framework name for SDK statistics tracking */
6595
+ framework?: string;
6591
6596
  }
6592
6597
  /**
6593
6598
  * CreateSessionParams provides a way to configure the parameters for creating a new session
6594
6599
  * in the AgentBay cloud environment.
6595
6600
  */
6596
- declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6601
+ declare class CreateSessionParams implements CreateSessionParamsConfig {
6597
6602
  /** Custom labels for the Session. These can be used for organizing and filtering sessions. */
6598
6603
  labels: Record<string, string>;
6599
6604
  /** Image ID to use for the session. */
@@ -6613,39 +6618,45 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6613
6618
  enableBrowserReplay: boolean;
6614
6619
  /** Extra configuration settings for different session types (e.g., mobile) */
6615
6620
  extraConfigs?: ExtraConfigs;
6621
+ /** Framework name for SDK statistics tracking */
6622
+ framework?: string;
6616
6623
  constructor();
6617
6624
  /**
6618
6625
  * WithLabels sets the labels for the session parameters and returns the updated parameters.
6619
6626
  */
6620
- withLabels(labels: Record<string, string>): CreateSessionParams$1;
6627
+ withLabels(labels: Record<string, string>): CreateSessionParams;
6621
6628
  /**
6622
6629
  * WithImageId sets the image ID for the session parameters and returns the updated parameters.
6623
6630
  */
6624
- withImageId(imageId: string): CreateSessionParams$1;
6631
+ withImageId(imageId: string): CreateSessionParams;
6625
6632
  /**
6626
6633
  * WithBrowserContext sets the browser context for the session parameters and returns the updated parameters.
6627
6634
  */
6628
- withBrowserContext(browserContext: BrowserContext): CreateSessionParams$1;
6635
+ withBrowserContext(browserContext: BrowserContext): CreateSessionParams;
6629
6636
  /**
6630
6637
  * WithIsVpc sets the VPC flag for the session parameters and returns the updated parameters.
6631
6638
  */
6632
- withIsVpc(isVpc: boolean): CreateSessionParams$1;
6639
+ withIsVpc(isVpc: boolean): CreateSessionParams;
6633
6640
  /**
6634
6641
  * WithPolicyId sets the policy id for the session parameters and returns the updated parameters.
6635
6642
  */
6636
- withPolicyId(policyId: string): CreateSessionParams$1;
6643
+ withPolicyId(policyId: string): CreateSessionParams;
6637
6644
  /**
6638
6645
  * WithenableBrowserReplay sets the browser recording flag for the session parameters and returns the updated parameters.
6639
6646
  */
6640
- withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams$1;
6647
+ withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams;
6641
6648
  /**
6642
6649
  * Alias for withEnableBrowserReplay for backward compatibility.
6643
6650
  */
6644
- withEnableRecord(enableRecord: boolean): CreateSessionParams$1;
6651
+ withEnableRecord(enableRecord: boolean): CreateSessionParams;
6645
6652
  /**
6646
6653
  * WithExtraConfigs sets the extra configurations for the session parameters and returns the updated parameters.
6647
6654
  */
6648
- withExtraConfigs(extraConfigs: ExtraConfigs): CreateSessionParams$1;
6655
+ withExtraConfigs(extraConfigs: ExtraConfigs): CreateSessionParams;
6656
+ /**
6657
+ * WithFramework sets the framework name for the session parameters and returns the updated parameters.
6658
+ */
6659
+ withFramework(framework: string): CreateSessionParams;
6649
6660
  /**
6650
6661
  * GetLabelsJSON returns the labels as a JSON string.
6651
6662
  * Returns an object with success status and result/error message to match Go version behavior.
@@ -6659,15 +6670,15 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6659
6670
  /**
6660
6671
  * AddContextSync adds a context sync configuration to the session parameters.
6661
6672
  */
6662
- addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams$1;
6673
+ addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams;
6663
6674
  /**
6664
6675
  * AddContextSyncConfig adds a pre-configured context sync to the session parameters.
6665
6676
  */
6666
- addContextSyncConfig(contextSync: ContextSync): CreateSessionParams$1;
6677
+ addContextSyncConfig(contextSync: ContextSync): CreateSessionParams;
6667
6678
  /**
6668
6679
  * WithContextSync sets the context sync configurations for the session parameters.
6669
6680
  */
6670
- withContextSync(contextSyncs: ContextSync[]): CreateSessionParams$1;
6681
+ withContextSync(contextSyncs: ContextSync[]): CreateSessionParams;
6671
6682
  /**
6672
6683
  * Convert to plain object for JSON serialization
6673
6684
  */
@@ -6675,12 +6686,12 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
6675
6686
  /**
6676
6687
  * Create from plain object
6677
6688
  */
6678
- static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams$1;
6689
+ static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams;
6679
6690
  }
6680
6691
  /**
6681
6692
  * NewCreateSessionParams creates a new CreateSessionParams with default values.
6682
6693
  */
6683
- declare function newCreateSessionParams(): CreateSessionParams$1;
6694
+ declare function newCreateSessionParams(): CreateSessionParams;
6684
6695
 
6685
6696
  /**
6686
6697
  * Parameters for listing sessions with pagination support
@@ -6714,7 +6725,7 @@ declare function createListSessionParams(labels?: Record<string, string>): ListS
6714
6725
  /**
6715
6726
  * Parameters for creating a session.
6716
6727
  */
6717
- interface CreateSessionParams {
6728
+ interface CreateSeesionWithParams {
6718
6729
  labels?: Record<string, string>;
6719
6730
  imageId?: string;
6720
6731
  contextSync?: ContextSync[];
@@ -6730,7 +6741,7 @@ interface CreateSessionParams {
6730
6741
  */
6731
6742
  declare class AgentBay {
6732
6743
  private apiKey;
6733
- private client;
6744
+ client: Client;
6734
6745
  private endpoint;
6735
6746
  private fileTransferContext;
6736
6747
  private config;
@@ -6819,7 +6830,7 @@ declare class AgentBay {
6819
6830
  *
6820
6831
  * @see {@link get}, {@link list}, {@link Session.delete}
6821
6832
  */
6822
- create(params?: CreateSessionParams): Promise<SessionResult>;
6833
+ create(params: CreateSessionParams | CreateSeesionWithParams): Promise<SessionResult>;
6823
6834
  /**
6824
6835
  * Returns paginated list of session IDs filtered by labels.
6825
6836
  *
@@ -7280,4 +7291,4 @@ declare function logWarn(message: string, ...args: any[]): void;
7280
7291
  */
7281
7292
  declare function logError(message: string, error?: any): void;
7282
7293
 
7283
- export { APIError, APP_BLACKLIST_TEMPLATE, APP_WHITELIST_TEMPLATE, type ActOptions, ActResult, Agent, AgentBay, AgentBayError, type AgentOptions, type ApiResponse, type ApiResponseWithData, type AppManagerRule, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, type Brand, Browser, BrowserAgent, BrowserContext, BrowserError, type BrowserFingerprint, BrowserFingerprintContext, BrowserFingerprintGenerator, type BrowserOption, BrowserOptionClass, type BrowserProxy, BrowserProxyClass, type BrowserScreen, BrowserUseAgent, type BrowserViewport, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, ClearContextRequest, ClearContextResponse, ClearContextResponseBody, Client, Code, Command, Computer, ComputerUseAgent, type Config, Context, type ContextInfoResult, ContextManager, ContextService, type ContextStatusData, type ContextStatusItem, ContextSync, type ContextSyncResult, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, type CreateSessionParams, type CreateSessionParamsConfig, DeleteContextFileRequest, DeleteContextFileResponse, DeleteContextFileResponseBody, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, type DeleteResult, DescribeContextFilesRequest, DescribeContextFilesResponse, DescribeContextFilesResponseBody, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, type ExecutionResult, Extension, ExtensionOption, ExtensionsService, type ExtraConfigs, type ExtraProperties, type ExtractOptions, type ExtractPolicy, ExtractPolicyClass, type FileChangeEvent, FileChangeEventHelper, type FileChangeResult, FileChangeResultHelper, FileError, type FileInfo, FileSystem, type Fingerprint, FingerprintFormat, GetAdbLinkRequest, GetAdbLinkResponse, GetAdbLinkResponseBody, GetAdbLinkResponseBodyData, GetCdpLinkRequest, GetCdpLinkResponse, GetCdpLinkResponseBody, GetCdpLinkResponseBodyData, GetContextFileDownloadUrlRequest, GetContextFileDownloadUrlResponse, GetContextFileDownloadUrlResponseBody, GetContextFileUploadUrlRequest, GetContextFileUploadUrlResponse, GetContextFileUploadUrlResponseBody, GetContextInfoRequest, GetContextInfoResponse, GetContextInfoResponseBody, GetContextInfoResponseBodyData, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetLinkResponseBodyData, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, GetSessionRequest, GetSessionResponse, GetSessionResponseBody, GetSessionResponseBodyData, HIDE_NAVIGATION_BAR_TEMPLATE, IS_RELEASE, InitBrowserRequest, InitBrowserResponse, InitBrowserResponseBody, InitBrowserResponseBodyData, type InitializationResult, Lifecycle, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, type LogLevel, type LoggerConfig, MOBILE_COMMAND_TEMPLATES, type MappingPolicy, type McpSession, type McpToolResult, Mobile, type MobileExtraConfig, type MobileSimulateConfig, MobileSimulateMode, MobileSimulateService, type MobileSimulateUploadResult, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, type NavigatorFingerprint, type ObserveOptions, ObserveResult, Oss, OssError, PauseSessionAsyncRequest, PauseSessionAsyncResponse, PauseSessionAsyncResponseBody, type QueryResult, RESOLUTION_LOCK_TEMPLATE, type RecyclePolicy, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, ResumeSessionAsyncRequest, ResumeSessionAsyncResponse, ResumeSessionAsyncResponseBody, SHOW_NAVIGATION_BAR_TEMPLATE, type ScreenFingerprint, Session, SessionError, type SessionInterface, type SessionListResult, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, type SyncCallback, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, SyncPolicyImpl, UNINSTALL_BLACKLIST_TEMPLATE, UploadMode, type UploadPolicy, UploadStrategy, type UserAgentData, VERSION, type VideoCard, type WhiteList, WhiteListValidator, createListSessionParams, extraConfigsFromJSON, extraConfigsToJSON, extractRequestId, getLogLevel, getMobileCommandTemplate, hasMobileCommandTemplate, log, logDebug, logError, logInfo, logWarn, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newExtractPolicy, newMappingPolicy, newRecyclePolicy, newSyncPolicy, newSyncPolicyWithDefaults, newUploadPolicy, replaceTemplatePlaceholders, setLogLevel, setupLogger, validateAppManagerRule, validateExtraConfigs, validateMobileExtraConfig, validateMobileSimulateConfig };
7294
+ export { APIError, APP_BLACKLIST_TEMPLATE, APP_WHITELIST_TEMPLATE, type ActOptions, ActResult, Agent, AgentBay, AgentBayError, type AgentOptions, type ApiResponse, type ApiResponseWithData, type AppManagerRule, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, type Brand, Browser, BrowserAgent, BrowserContext, BrowserError, type BrowserFingerprint, BrowserFingerprintContext, BrowserFingerprintGenerator, type BrowserOption, BrowserOptionClass, type BrowserProxy, BrowserProxyClass, type BrowserScreen, BrowserUseAgent, type BrowserViewport, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, ClearContextRequest, ClearContextResponse, ClearContextResponseBody, Client, Code, Command, Computer, ComputerUseAgent, type Config, Context, type ContextInfoResult, ContextManager, ContextService, type ContextStatusData, type ContextStatusItem, ContextSync, type ContextSyncResult, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, CreateSessionParams, type CreateSessionParamsConfig, DeleteContextFileRequest, DeleteContextFileResponse, DeleteContextFileResponseBody, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, type DeleteResult, DescribeContextFilesRequest, DescribeContextFilesResponse, DescribeContextFilesResponseBody, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, type ExecutionResult, Extension, ExtensionOption, ExtensionsService, type ExtraConfigs, type ExtraProperties, type ExtractOptions, type ExtractPolicy, ExtractPolicyClass, type FileChangeEvent, FileChangeEventHelper, type FileChangeResult, FileChangeResultHelper, FileError, type FileInfo, FileSystem, type Fingerprint, FingerprintFormat, GetAdbLinkRequest, GetAdbLinkResponse, GetAdbLinkResponseBody, GetAdbLinkResponseBodyData, GetCdpLinkRequest, GetCdpLinkResponse, GetCdpLinkResponseBody, GetCdpLinkResponseBodyData, GetContextFileDownloadUrlRequest, GetContextFileDownloadUrlResponse, GetContextFileDownloadUrlResponseBody, GetContextFileUploadUrlRequest, GetContextFileUploadUrlResponse, GetContextFileUploadUrlResponseBody, GetContextInfoRequest, GetContextInfoResponse, GetContextInfoResponseBody, GetContextInfoResponseBodyData, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetLinkResponseBodyData, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, GetSessionRequest, GetSessionResponse, GetSessionResponseBody, GetSessionResponseBodyData, HIDE_NAVIGATION_BAR_TEMPLATE, IS_RELEASE, InitBrowserRequest, InitBrowserResponse, InitBrowserResponseBody, InitBrowserResponseBodyData, type InitializationResult, Lifecycle, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, type LogLevel, type LoggerConfig, MOBILE_COMMAND_TEMPLATES, type MappingPolicy, type McpSession, type McpToolResult, Mobile, type MobileExtraConfig, type MobileSimulateConfig, MobileSimulateMode, MobileSimulateService, type MobileSimulateUploadResult, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, type NavigatorFingerprint, type ObserveOptions, ObserveResult, Oss, OssError, PauseSessionAsyncRequest, PauseSessionAsyncResponse, PauseSessionAsyncResponseBody, type QueryResult, RESOLUTION_LOCK_TEMPLATE, type RecyclePolicy, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, ResumeSessionAsyncRequest, ResumeSessionAsyncResponse, ResumeSessionAsyncResponseBody, SHOW_NAVIGATION_BAR_TEMPLATE, type ScreenFingerprint, Session, SessionError, type SessionInterface, type SessionListResult, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, type SyncCallback, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, SyncPolicyImpl, UNINSTALL_BLACKLIST_TEMPLATE, UploadMode, type UploadPolicy, UploadStrategy, type UserAgentData, VERSION, type VideoCard, type WhiteList, WhiteListValidator, createListSessionParams, extraConfigsFromJSON, extraConfigsToJSON, extractRequestId, getLogLevel, getMobileCommandTemplate, hasMobileCommandTemplate, log, logDebug, logError, logInfo, logWarn, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newExtractPolicy, newMappingPolicy, newRecyclePolicy, newSyncPolicy, newSyncPolicyWithDefaults, newUploadPolicy, replaceTemplatePlaceholders, setLogLevel, setupLogger, validateAppManagerRule, validateExtraConfigs, validateMobileExtraConfig, validateMobileSimulateConfig };