mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-21 10:00:43 +00:00
feat: [US-023] - Add TypeScript SDK browser interaction methods
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f4c43a5ac5
commit
264ec25578
1 changed files with 35 additions and 0 deletions
|
|
@ -31,11 +31,14 @@ import {
|
||||||
type AgentInstallResponse,
|
type AgentInstallResponse,
|
||||||
type AgentListResponse,
|
type AgentListResponse,
|
||||||
type BrowserActionResponse,
|
type BrowserActionResponse,
|
||||||
|
type BrowserClickRequest,
|
||||||
type BrowserContentQuery,
|
type BrowserContentQuery,
|
||||||
type BrowserContentResponse,
|
type BrowserContentResponse,
|
||||||
type BrowserCreateTabRequest,
|
type BrowserCreateTabRequest,
|
||||||
|
type BrowserDialogRequest,
|
||||||
type BrowserExecuteRequest,
|
type BrowserExecuteRequest,
|
||||||
type BrowserExecuteResponse,
|
type BrowserExecuteResponse,
|
||||||
|
type BrowserHoverRequest,
|
||||||
type BrowserLinksResponse,
|
type BrowserLinksResponse,
|
||||||
type BrowserMarkdownResponse,
|
type BrowserMarkdownResponse,
|
||||||
type BrowserNavigateRequest,
|
type BrowserNavigateRequest,
|
||||||
|
|
@ -43,13 +46,17 @@ import {
|
||||||
type BrowserPdfQuery,
|
type BrowserPdfQuery,
|
||||||
type BrowserReloadRequest,
|
type BrowserReloadRequest,
|
||||||
type BrowserScreenshotQuery,
|
type BrowserScreenshotQuery,
|
||||||
|
type BrowserScrollRequest,
|
||||||
type BrowserScrapeRequest,
|
type BrowserScrapeRequest,
|
||||||
type BrowserScrapeResponse,
|
type BrowserScrapeResponse,
|
||||||
|
type BrowserSelectRequest,
|
||||||
type BrowserSnapshotResponse,
|
type BrowserSnapshotResponse,
|
||||||
type BrowserStartRequest,
|
type BrowserStartRequest,
|
||||||
type BrowserStatusResponse,
|
type BrowserStatusResponse,
|
||||||
type BrowserTabInfo,
|
type BrowserTabInfo,
|
||||||
type BrowserTabListResponse,
|
type BrowserTabListResponse,
|
||||||
|
type BrowserTypeRequest,
|
||||||
|
type BrowserUploadRequest,
|
||||||
type BrowserWaitRequest,
|
type BrowserWaitRequest,
|
||||||
type BrowserWaitResponse,
|
type BrowserWaitResponse,
|
||||||
type DesktopActionResponse,
|
type DesktopActionResponse,
|
||||||
|
|
@ -2138,6 +2145,34 @@ export class SandboxAgent {
|
||||||
return this.requestJson("GET", `${API_PREFIX}/browser/snapshot`);
|
return this.requestJson("GET", `${API_PREFIX}/browser/snapshot`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async browserClick(request: BrowserClickRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/click`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
|
async browserType(request: BrowserTypeRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/type`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
|
async browserSelect(request: BrowserSelectRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/select`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
|
async browserHover(request: BrowserHoverRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/hover`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
|
async browserScroll(request: BrowserScrollRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/scroll`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
|
async browserUpload(request: BrowserUploadRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/upload`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
|
async browserDialog(request: BrowserDialogRequest): Promise<BrowserActionResponse> {
|
||||||
|
return this.requestJson("POST", `${API_PREFIX}/browser/dialog`, { body: request });
|
||||||
|
}
|
||||||
|
|
||||||
private async getLiveConnection(agent: string): Promise<LiveAcpConnection> {
|
private async getLiveConnection(agent: string): Promise<LiveAcpConnection> {
|
||||||
await this.awaitHealthy();
|
await this.awaitHealthy();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue