test-wuying-agentbay-sdk 0.13.0-beta.20251212140302 → 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.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +26 -18
- package/dist/index.d.ts +26 -18
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/docs/examples/codespace/enhanced_code/index.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6591,12 +6591,14 @@ interface CreateSessionParamsConfig {
|
|
|
6591
6591
|
enableBrowserReplay?: boolean;
|
|
6592
6592
|
/** Extra configuration settings for different session types (e.g., mobile) */
|
|
6593
6593
|
extraConfigs?: ExtraConfigs;
|
|
6594
|
+
/** Framework name for SDK statistics tracking */
|
|
6595
|
+
framework?: string;
|
|
6594
6596
|
}
|
|
6595
6597
|
/**
|
|
6596
6598
|
* CreateSessionParams provides a way to configure the parameters for creating a new session
|
|
6597
6599
|
* in the AgentBay cloud environment.
|
|
6598
6600
|
*/
|
|
6599
|
-
declare class CreateSessionParams
|
|
6601
|
+
declare class CreateSessionParams implements CreateSessionParamsConfig {
|
|
6600
6602
|
/** Custom labels for the Session. These can be used for organizing and filtering sessions. */
|
|
6601
6603
|
labels: Record<string, string>;
|
|
6602
6604
|
/** Image ID to use for the session. */
|
|
@@ -6616,39 +6618,45 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
6616
6618
|
enableBrowserReplay: boolean;
|
|
6617
6619
|
/** Extra configuration settings for different session types (e.g., mobile) */
|
|
6618
6620
|
extraConfigs?: ExtraConfigs;
|
|
6621
|
+
/** Framework name for SDK statistics tracking */
|
|
6622
|
+
framework?: string;
|
|
6619
6623
|
constructor();
|
|
6620
6624
|
/**
|
|
6621
6625
|
* WithLabels sets the labels for the session parameters and returns the updated parameters.
|
|
6622
6626
|
*/
|
|
6623
|
-
withLabels(labels: Record<string, string>): CreateSessionParams
|
|
6627
|
+
withLabels(labels: Record<string, string>): CreateSessionParams;
|
|
6624
6628
|
/**
|
|
6625
6629
|
* WithImageId sets the image ID for the session parameters and returns the updated parameters.
|
|
6626
6630
|
*/
|
|
6627
|
-
withImageId(imageId: string): CreateSessionParams
|
|
6631
|
+
withImageId(imageId: string): CreateSessionParams;
|
|
6628
6632
|
/**
|
|
6629
6633
|
* WithBrowserContext sets the browser context for the session parameters and returns the updated parameters.
|
|
6630
6634
|
*/
|
|
6631
|
-
withBrowserContext(browserContext: BrowserContext): CreateSessionParams
|
|
6635
|
+
withBrowserContext(browserContext: BrowserContext): CreateSessionParams;
|
|
6632
6636
|
/**
|
|
6633
6637
|
* WithIsVpc sets the VPC flag for the session parameters and returns the updated parameters.
|
|
6634
6638
|
*/
|
|
6635
|
-
withIsVpc(isVpc: boolean): CreateSessionParams
|
|
6639
|
+
withIsVpc(isVpc: boolean): CreateSessionParams;
|
|
6636
6640
|
/**
|
|
6637
6641
|
* WithPolicyId sets the policy id for the session parameters and returns the updated parameters.
|
|
6638
6642
|
*/
|
|
6639
|
-
withPolicyId(policyId: string): CreateSessionParams
|
|
6643
|
+
withPolicyId(policyId: string): CreateSessionParams;
|
|
6640
6644
|
/**
|
|
6641
6645
|
* WithenableBrowserReplay sets the browser recording flag for the session parameters and returns the updated parameters.
|
|
6642
6646
|
*/
|
|
6643
|
-
withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams
|
|
6647
|
+
withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams;
|
|
6644
6648
|
/**
|
|
6645
6649
|
* Alias for withEnableBrowserReplay for backward compatibility.
|
|
6646
6650
|
*/
|
|
6647
|
-
withEnableRecord(enableRecord: boolean): CreateSessionParams
|
|
6651
|
+
withEnableRecord(enableRecord: boolean): CreateSessionParams;
|
|
6648
6652
|
/**
|
|
6649
6653
|
* WithExtraConfigs sets the extra configurations for the session parameters and returns the updated parameters.
|
|
6650
6654
|
*/
|
|
6651
|
-
withExtraConfigs(extraConfigs: ExtraConfigs): CreateSessionParams
|
|
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;
|
|
6652
6660
|
/**
|
|
6653
6661
|
* GetLabelsJSON returns the labels as a JSON string.
|
|
6654
6662
|
* Returns an object with success status and result/error message to match Go version behavior.
|
|
@@ -6662,15 +6670,15 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
6662
6670
|
/**
|
|
6663
6671
|
* AddContextSync adds a context sync configuration to the session parameters.
|
|
6664
6672
|
*/
|
|
6665
|
-
addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams
|
|
6673
|
+
addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams;
|
|
6666
6674
|
/**
|
|
6667
6675
|
* AddContextSyncConfig adds a pre-configured context sync to the session parameters.
|
|
6668
6676
|
*/
|
|
6669
|
-
addContextSyncConfig(contextSync: ContextSync): CreateSessionParams
|
|
6677
|
+
addContextSyncConfig(contextSync: ContextSync): CreateSessionParams;
|
|
6670
6678
|
/**
|
|
6671
6679
|
* WithContextSync sets the context sync configurations for the session parameters.
|
|
6672
6680
|
*/
|
|
6673
|
-
withContextSync(contextSyncs: ContextSync[]): CreateSessionParams
|
|
6681
|
+
withContextSync(contextSyncs: ContextSync[]): CreateSessionParams;
|
|
6674
6682
|
/**
|
|
6675
6683
|
* Convert to plain object for JSON serialization
|
|
6676
6684
|
*/
|
|
@@ -6678,12 +6686,12 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
6678
6686
|
/**
|
|
6679
6687
|
* Create from plain object
|
|
6680
6688
|
*/
|
|
6681
|
-
static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams
|
|
6689
|
+
static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams;
|
|
6682
6690
|
}
|
|
6683
6691
|
/**
|
|
6684
6692
|
* NewCreateSessionParams creates a new CreateSessionParams with default values.
|
|
6685
6693
|
*/
|
|
6686
|
-
declare function newCreateSessionParams(): CreateSessionParams
|
|
6694
|
+
declare function newCreateSessionParams(): CreateSessionParams;
|
|
6687
6695
|
|
|
6688
6696
|
/**
|
|
6689
6697
|
* Parameters for listing sessions with pagination support
|
|
@@ -6717,7 +6725,7 @@ declare function createListSessionParams(labels?: Record<string, string>): ListS
|
|
|
6717
6725
|
/**
|
|
6718
6726
|
* Parameters for creating a session.
|
|
6719
6727
|
*/
|
|
6720
|
-
interface
|
|
6728
|
+
interface CreateSeesionWithParams {
|
|
6721
6729
|
labels?: Record<string, string>;
|
|
6722
6730
|
imageId?: string;
|
|
6723
6731
|
contextSync?: ContextSync[];
|
|
@@ -6733,7 +6741,7 @@ interface CreateSessionParams {
|
|
|
6733
6741
|
*/
|
|
6734
6742
|
declare class AgentBay {
|
|
6735
6743
|
private apiKey;
|
|
6736
|
-
|
|
6744
|
+
client: Client;
|
|
6737
6745
|
private endpoint;
|
|
6738
6746
|
private fileTransferContext;
|
|
6739
6747
|
private config;
|
|
@@ -6822,7 +6830,7 @@ declare class AgentBay {
|
|
|
6822
6830
|
*
|
|
6823
6831
|
* @see {@link get}, {@link list}, {@link Session.delete}
|
|
6824
6832
|
*/
|
|
6825
|
-
create(params
|
|
6833
|
+
create(params: CreateSessionParams | CreateSeesionWithParams): Promise<SessionResult>;
|
|
6826
6834
|
/**
|
|
6827
6835
|
* Returns paginated list of session IDs filtered by labels.
|
|
6828
6836
|
*
|
|
@@ -7283,4 +7291,4 @@ declare function logWarn(message: string, ...args: any[]): void;
|
|
|
7283
7291
|
*/
|
|
7284
7292
|
declare function logError(message: string, error?: any): void;
|
|
7285
7293
|
|
|
7286
|
-
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,
|
|
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
|
@@ -6591,12 +6591,14 @@ interface CreateSessionParamsConfig {
|
|
|
6591
6591
|
enableBrowserReplay?: boolean;
|
|
6592
6592
|
/** Extra configuration settings for different session types (e.g., mobile) */
|
|
6593
6593
|
extraConfigs?: ExtraConfigs;
|
|
6594
|
+
/** Framework name for SDK statistics tracking */
|
|
6595
|
+
framework?: string;
|
|
6594
6596
|
}
|
|
6595
6597
|
/**
|
|
6596
6598
|
* CreateSessionParams provides a way to configure the parameters for creating a new session
|
|
6597
6599
|
* in the AgentBay cloud environment.
|
|
6598
6600
|
*/
|
|
6599
|
-
declare class CreateSessionParams
|
|
6601
|
+
declare class CreateSessionParams implements CreateSessionParamsConfig {
|
|
6600
6602
|
/** Custom labels for the Session. These can be used for organizing and filtering sessions. */
|
|
6601
6603
|
labels: Record<string, string>;
|
|
6602
6604
|
/** Image ID to use for the session. */
|
|
@@ -6616,39 +6618,45 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
6616
6618
|
enableBrowserReplay: boolean;
|
|
6617
6619
|
/** Extra configuration settings for different session types (e.g., mobile) */
|
|
6618
6620
|
extraConfigs?: ExtraConfigs;
|
|
6621
|
+
/** Framework name for SDK statistics tracking */
|
|
6622
|
+
framework?: string;
|
|
6619
6623
|
constructor();
|
|
6620
6624
|
/**
|
|
6621
6625
|
* WithLabels sets the labels for the session parameters and returns the updated parameters.
|
|
6622
6626
|
*/
|
|
6623
|
-
withLabels(labels: Record<string, string>): CreateSessionParams
|
|
6627
|
+
withLabels(labels: Record<string, string>): CreateSessionParams;
|
|
6624
6628
|
/**
|
|
6625
6629
|
* WithImageId sets the image ID for the session parameters and returns the updated parameters.
|
|
6626
6630
|
*/
|
|
6627
|
-
withImageId(imageId: string): CreateSessionParams
|
|
6631
|
+
withImageId(imageId: string): CreateSessionParams;
|
|
6628
6632
|
/**
|
|
6629
6633
|
* WithBrowserContext sets the browser context for the session parameters and returns the updated parameters.
|
|
6630
6634
|
*/
|
|
6631
|
-
withBrowserContext(browserContext: BrowserContext): CreateSessionParams
|
|
6635
|
+
withBrowserContext(browserContext: BrowserContext): CreateSessionParams;
|
|
6632
6636
|
/**
|
|
6633
6637
|
* WithIsVpc sets the VPC flag for the session parameters and returns the updated parameters.
|
|
6634
6638
|
*/
|
|
6635
|
-
withIsVpc(isVpc: boolean): CreateSessionParams
|
|
6639
|
+
withIsVpc(isVpc: boolean): CreateSessionParams;
|
|
6636
6640
|
/**
|
|
6637
6641
|
* WithPolicyId sets the policy id for the session parameters and returns the updated parameters.
|
|
6638
6642
|
*/
|
|
6639
|
-
withPolicyId(policyId: string): CreateSessionParams
|
|
6643
|
+
withPolicyId(policyId: string): CreateSessionParams;
|
|
6640
6644
|
/**
|
|
6641
6645
|
* WithenableBrowserReplay sets the browser recording flag for the session parameters and returns the updated parameters.
|
|
6642
6646
|
*/
|
|
6643
|
-
withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams
|
|
6647
|
+
withEnableBrowserReplay(enableBrowserReplay: boolean): CreateSessionParams;
|
|
6644
6648
|
/**
|
|
6645
6649
|
* Alias for withEnableBrowserReplay for backward compatibility.
|
|
6646
6650
|
*/
|
|
6647
|
-
withEnableRecord(enableRecord: boolean): CreateSessionParams
|
|
6651
|
+
withEnableRecord(enableRecord: boolean): CreateSessionParams;
|
|
6648
6652
|
/**
|
|
6649
6653
|
* WithExtraConfigs sets the extra configurations for the session parameters and returns the updated parameters.
|
|
6650
6654
|
*/
|
|
6651
|
-
withExtraConfigs(extraConfigs: ExtraConfigs): CreateSessionParams
|
|
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;
|
|
6652
6660
|
/**
|
|
6653
6661
|
* GetLabelsJSON returns the labels as a JSON string.
|
|
6654
6662
|
* Returns an object with success status and result/error message to match Go version behavior.
|
|
@@ -6662,15 +6670,15 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
6662
6670
|
/**
|
|
6663
6671
|
* AddContextSync adds a context sync configuration to the session parameters.
|
|
6664
6672
|
*/
|
|
6665
|
-
addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams
|
|
6673
|
+
addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams;
|
|
6666
6674
|
/**
|
|
6667
6675
|
* AddContextSyncConfig adds a pre-configured context sync to the session parameters.
|
|
6668
6676
|
*/
|
|
6669
|
-
addContextSyncConfig(contextSync: ContextSync): CreateSessionParams
|
|
6677
|
+
addContextSyncConfig(contextSync: ContextSync): CreateSessionParams;
|
|
6670
6678
|
/**
|
|
6671
6679
|
* WithContextSync sets the context sync configurations for the session parameters.
|
|
6672
6680
|
*/
|
|
6673
|
-
withContextSync(contextSyncs: ContextSync[]): CreateSessionParams
|
|
6681
|
+
withContextSync(contextSyncs: ContextSync[]): CreateSessionParams;
|
|
6674
6682
|
/**
|
|
6675
6683
|
* Convert to plain object for JSON serialization
|
|
6676
6684
|
*/
|
|
@@ -6678,12 +6686,12 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
6678
6686
|
/**
|
|
6679
6687
|
* Create from plain object
|
|
6680
6688
|
*/
|
|
6681
|
-
static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams
|
|
6689
|
+
static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams;
|
|
6682
6690
|
}
|
|
6683
6691
|
/**
|
|
6684
6692
|
* NewCreateSessionParams creates a new CreateSessionParams with default values.
|
|
6685
6693
|
*/
|
|
6686
|
-
declare function newCreateSessionParams(): CreateSessionParams
|
|
6694
|
+
declare function newCreateSessionParams(): CreateSessionParams;
|
|
6687
6695
|
|
|
6688
6696
|
/**
|
|
6689
6697
|
* Parameters for listing sessions with pagination support
|
|
@@ -6717,7 +6725,7 @@ declare function createListSessionParams(labels?: Record<string, string>): ListS
|
|
|
6717
6725
|
/**
|
|
6718
6726
|
* Parameters for creating a session.
|
|
6719
6727
|
*/
|
|
6720
|
-
interface
|
|
6728
|
+
interface CreateSeesionWithParams {
|
|
6721
6729
|
labels?: Record<string, string>;
|
|
6722
6730
|
imageId?: string;
|
|
6723
6731
|
contextSync?: ContextSync[];
|
|
@@ -6733,7 +6741,7 @@ interface CreateSessionParams {
|
|
|
6733
6741
|
*/
|
|
6734
6742
|
declare class AgentBay {
|
|
6735
6743
|
private apiKey;
|
|
6736
|
-
|
|
6744
|
+
client: Client;
|
|
6737
6745
|
private endpoint;
|
|
6738
6746
|
private fileTransferContext;
|
|
6739
6747
|
private config;
|
|
@@ -6822,7 +6830,7 @@ declare class AgentBay {
|
|
|
6822
6830
|
*
|
|
6823
6831
|
* @see {@link get}, {@link list}, {@link Session.delete}
|
|
6824
6832
|
*/
|
|
6825
|
-
create(params
|
|
6833
|
+
create(params: CreateSessionParams | CreateSeesionWithParams): Promise<SessionResult>;
|
|
6826
6834
|
/**
|
|
6827
6835
|
* Returns paginated list of session IDs filtered by labels.
|
|
6828
6836
|
*
|
|
@@ -7283,4 +7291,4 @@ declare function logWarn(message: string, ...args: any[]): void;
|
|
|
7283
7291
|
*/
|
|
7284
7292
|
declare function logError(message: string, error?: any): void;
|
|
7285
7293
|
|
|
7286
|
-
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,
|
|
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.mjs
CHANGED
|
@@ -10598,8 +10598,12 @@ var _BrowserOptionClass = class _BrowserOptionClass {
|
|
|
10598
10598
|
optionMap["fingerprint"] = fp;
|
|
10599
10599
|
}
|
|
10600
10600
|
if (this.fingerprintFormat !== void 0) {
|
|
10601
|
-
|
|
10602
|
-
|
|
10601
|
+
try {
|
|
10602
|
+
const jsonStr = this.fingerprintFormat.toJson();
|
|
10603
|
+
optionMap["fingerprintRawData"] = Buffer.from(jsonStr, "utf-8").toString("base64");
|
|
10604
|
+
} catch (error) {
|
|
10605
|
+
logError("Failed to serialize fingerprint format:", error);
|
|
10606
|
+
}
|
|
10603
10607
|
}
|
|
10604
10608
|
if (this.fingerprintPersistent) {
|
|
10605
10609
|
this.fingerprintPersistPath = `${BROWSER_FINGERPRINT_PERSIST_PATH}/fingerprint.json`;
|
|
@@ -16997,7 +17001,7 @@ var _AgentBay = class _AgentBay {
|
|
|
16997
17001
|
*
|
|
16998
17002
|
* @see {@link get}, {@link list}, {@link Session.delete}
|
|
16999
17003
|
*/
|
|
17000
|
-
async create(params
|
|
17004
|
+
async create(params) {
|
|
17001
17005
|
try {
|
|
17002
17006
|
logDebug(`default context syncs length: ${params.contextSync?.length}`);
|
|
17003
17007
|
if (params.extraConfigs?.mobile?.simulateConfig) {
|
|
@@ -18833,6 +18837,13 @@ var _CreateSessionParams = class _CreateSessionParams {
|
|
|
18833
18837
|
this.extraConfigs = extraConfigs;
|
|
18834
18838
|
return this;
|
|
18835
18839
|
}
|
|
18840
|
+
/**
|
|
18841
|
+
* WithFramework sets the framework name for the session parameters and returns the updated parameters.
|
|
18842
|
+
*/
|
|
18843
|
+
withFramework(framework) {
|
|
18844
|
+
this.framework = framework;
|
|
18845
|
+
return this;
|
|
18846
|
+
}
|
|
18836
18847
|
/**
|
|
18837
18848
|
* GetLabelsJSON returns the labels as a JSON string.
|
|
18838
18849
|
* Returns an object with success status and result/error message to match Go version behavior.
|