hyperbrowser 0.48.0__tar.gz → 0.50.0__tar.gz
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.
Potentially problematic release.
This version of hyperbrowser might be problematic. Click here for more details.
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/PKG-INFO +1 -1
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/async_client.py +2 -0
- hyperbrowser-0.50.0/hyperbrowser/client/managers/async_manager/computer_action.py +120 -0
- hyperbrowser-0.50.0/hyperbrowser/client/managers/sync_manager/computer_action.py +120 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/sync.py +2 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/__init__.py +33 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/agents/browser_use.py +20 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/agents/claude_computer_use.py +18 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/agents/cua.py +16 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/agents/hyper_agent.py +20 -0
- hyperbrowser-0.50.0/hyperbrowser/models/computer_action.py +135 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/session.py +4 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/pyproject.toml +1 -1
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/LICENSE +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/README.md +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/__init__.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/base.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/agents/__init__.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/agents/browser_use.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/agents/claude_computer_use.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/agents/cua.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/agents/hyper_agent.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/crawl.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/extension.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/extract.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/profile.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/scrape.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/session.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/team.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/agents/__init__.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/agents/browser_use.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/agents/claude_computer_use.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/agents/cua.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/agents/hyper_agent.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/crawl.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/extension.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/extract.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/profile.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/scrape.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/session.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/team.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/config.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/exceptions.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/consts.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/crawl.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/extension.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/extract.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/profile.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/scrape.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/team.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/tools/__init__.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/tools/anthropic.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/tools/openai.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/tools/schema.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/transport/async_transport.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/transport/base.py +0 -0
- {hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/transport/sync.py +0 -0
|
@@ -11,6 +11,7 @@ from .managers.async_manager.profile import ProfileManager
|
|
|
11
11
|
from .managers.async_manager.scrape import ScrapeManager
|
|
12
12
|
from .managers.async_manager.session import SessionManager
|
|
13
13
|
from .managers.async_manager.team import TeamManager
|
|
14
|
+
from .managers.async_manager.computer_action import ComputerActionManager
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class AsyncHyperbrowser(HyperbrowserBase):
|
|
@@ -33,6 +34,7 @@ class AsyncHyperbrowser(HyperbrowserBase):
|
|
|
33
34
|
self.extensions = ExtensionManager(self)
|
|
34
35
|
self.agents = Agents(self)
|
|
35
36
|
self.team = TeamManager(self)
|
|
37
|
+
self.computer_action = ComputerActionManager(self)
|
|
36
38
|
|
|
37
39
|
async def close(self) -> None:
|
|
38
40
|
await self.transport.close()
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Union, List
|
|
3
|
+
from hyperbrowser.models import (
|
|
4
|
+
SessionDetail,
|
|
5
|
+
ComputerActionParams,
|
|
6
|
+
ComputerActionResponse,
|
|
7
|
+
ClickActionParams,
|
|
8
|
+
DragActionParams,
|
|
9
|
+
PressKeysActionParams,
|
|
10
|
+
MoveMouseActionParams,
|
|
11
|
+
ScreenshotActionParams,
|
|
12
|
+
ScrollActionParams,
|
|
13
|
+
TypeTextActionParams,
|
|
14
|
+
Coordinate,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ComputerActionManager:
|
|
19
|
+
def __init__(self, client):
|
|
20
|
+
self._client = client
|
|
21
|
+
|
|
22
|
+
async def _execute_request(
|
|
23
|
+
self, session: Union[SessionDetail, str], params: ComputerActionParams
|
|
24
|
+
) -> ComputerActionResponse:
|
|
25
|
+
if isinstance(session, str):
|
|
26
|
+
session = await self._client.sessions.get(session)
|
|
27
|
+
|
|
28
|
+
if not session.computer_action_endpoint:
|
|
29
|
+
raise ValueError("Computer action endpoint not available for this session")
|
|
30
|
+
|
|
31
|
+
if isinstance(params, BaseModel):
|
|
32
|
+
payload = params.model_dump(by_alias=True, exclude_none=True)
|
|
33
|
+
else:
|
|
34
|
+
payload = params
|
|
35
|
+
|
|
36
|
+
response = await self._client.transport.post(
|
|
37
|
+
session.computer_action_endpoint,
|
|
38
|
+
data=payload,
|
|
39
|
+
)
|
|
40
|
+
return ComputerActionResponse(**response.data)
|
|
41
|
+
|
|
42
|
+
async def click(
|
|
43
|
+
self,
|
|
44
|
+
session: Union[SessionDetail, str],
|
|
45
|
+
x: int,
|
|
46
|
+
y: int,
|
|
47
|
+
button: str = "left",
|
|
48
|
+
num_clicks: int = 1,
|
|
49
|
+
return_screenshot: bool = False,
|
|
50
|
+
) -> ComputerActionResponse:
|
|
51
|
+
params = ClickActionParams(
|
|
52
|
+
x=x,
|
|
53
|
+
y=y,
|
|
54
|
+
button=button,
|
|
55
|
+
num_clicks=num_clicks,
|
|
56
|
+
return_screenshot=return_screenshot,
|
|
57
|
+
)
|
|
58
|
+
return await self._execute_request(session, params)
|
|
59
|
+
|
|
60
|
+
async def type_text(
|
|
61
|
+
self,
|
|
62
|
+
session: Union[SessionDetail, str],
|
|
63
|
+
text: str,
|
|
64
|
+
return_screenshot: bool = False,
|
|
65
|
+
) -> ComputerActionResponse:
|
|
66
|
+
params = TypeTextActionParams(text=text, return_screenshot=return_screenshot)
|
|
67
|
+
return await self._execute_request(session, params)
|
|
68
|
+
|
|
69
|
+
async def screenshot(
|
|
70
|
+
self,
|
|
71
|
+
session: Union[SessionDetail, str],
|
|
72
|
+
) -> ComputerActionResponse:
|
|
73
|
+
params = ScreenshotActionParams()
|
|
74
|
+
return await self._execute_request(session, params)
|
|
75
|
+
|
|
76
|
+
async def press_keys(
|
|
77
|
+
self,
|
|
78
|
+
session: Union[SessionDetail, str],
|
|
79
|
+
keys: List[str],
|
|
80
|
+
return_screenshot: bool = False,
|
|
81
|
+
) -> ComputerActionResponse:
|
|
82
|
+
params = PressKeysActionParams(keys=keys, return_screenshot=return_screenshot)
|
|
83
|
+
return await self._execute_request(session, params)
|
|
84
|
+
|
|
85
|
+
async def drag(
|
|
86
|
+
self,
|
|
87
|
+
session: Union[SessionDetail, str],
|
|
88
|
+
path: List[Coordinate],
|
|
89
|
+
return_screenshot: bool = False,
|
|
90
|
+
) -> ComputerActionResponse:
|
|
91
|
+
params = DragActionParams(path=path, return_screenshot=return_screenshot)
|
|
92
|
+
return await self._execute_request(session, params)
|
|
93
|
+
|
|
94
|
+
async def move_mouse(
|
|
95
|
+
self,
|
|
96
|
+
session: Union[SessionDetail, str],
|
|
97
|
+
x: int,
|
|
98
|
+
y: int,
|
|
99
|
+
return_screenshot: bool = False,
|
|
100
|
+
) -> ComputerActionResponse:
|
|
101
|
+
params = MoveMouseActionParams(x=x, y=y, return_screenshot=return_screenshot)
|
|
102
|
+
return await self._execute_request(session, params)
|
|
103
|
+
|
|
104
|
+
async def scroll(
|
|
105
|
+
self,
|
|
106
|
+
session: Union[SessionDetail, str],
|
|
107
|
+
x: int,
|
|
108
|
+
y: int,
|
|
109
|
+
scroll_x: int,
|
|
110
|
+
scroll_y: int,
|
|
111
|
+
return_screenshot: bool = False,
|
|
112
|
+
) -> ComputerActionResponse:
|
|
113
|
+
params = ScrollActionParams(
|
|
114
|
+
x=x,
|
|
115
|
+
y=y,
|
|
116
|
+
scroll_x=scroll_x,
|
|
117
|
+
scroll_y=scroll_y,
|
|
118
|
+
return_screenshot=return_screenshot,
|
|
119
|
+
)
|
|
120
|
+
return await self._execute_request(session, params)
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Union, List
|
|
3
|
+
from hyperbrowser.models import (
|
|
4
|
+
SessionDetail,
|
|
5
|
+
ComputerActionParams,
|
|
6
|
+
ComputerActionResponse,
|
|
7
|
+
ClickActionParams,
|
|
8
|
+
DragActionParams,
|
|
9
|
+
PressKeysActionParams,
|
|
10
|
+
MoveMouseActionParams,
|
|
11
|
+
ScreenshotActionParams,
|
|
12
|
+
ScrollActionParams,
|
|
13
|
+
TypeTextActionParams,
|
|
14
|
+
Coordinate,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ComputerActionManager:
|
|
19
|
+
def __init__(self, client):
|
|
20
|
+
self._client = client
|
|
21
|
+
|
|
22
|
+
def _execute_request(
|
|
23
|
+
self, session: Union[SessionDetail, str], params: ComputerActionParams
|
|
24
|
+
) -> ComputerActionResponse:
|
|
25
|
+
if isinstance(session, str):
|
|
26
|
+
session = self._client.sessions.get(session)
|
|
27
|
+
|
|
28
|
+
if not session.computer_action_endpoint:
|
|
29
|
+
raise ValueError("Computer action endpoint not available for this session")
|
|
30
|
+
|
|
31
|
+
if isinstance(params, BaseModel):
|
|
32
|
+
payload = params.model_dump(by_alias=True, exclude_none=True)
|
|
33
|
+
else:
|
|
34
|
+
payload = params
|
|
35
|
+
|
|
36
|
+
response = self._client.transport.post(
|
|
37
|
+
session.computer_action_endpoint,
|
|
38
|
+
data=payload,
|
|
39
|
+
)
|
|
40
|
+
return ComputerActionResponse(**response.data)
|
|
41
|
+
|
|
42
|
+
def click(
|
|
43
|
+
self,
|
|
44
|
+
session: Union[SessionDetail, str],
|
|
45
|
+
x: int,
|
|
46
|
+
y: int,
|
|
47
|
+
button: str = "left",
|
|
48
|
+
num_clicks: int = 1,
|
|
49
|
+
return_screenshot: bool = False,
|
|
50
|
+
) -> ComputerActionResponse:
|
|
51
|
+
params = ClickActionParams(
|
|
52
|
+
x=x,
|
|
53
|
+
y=y,
|
|
54
|
+
button=button,
|
|
55
|
+
num_clicks=num_clicks,
|
|
56
|
+
return_screenshot=return_screenshot,
|
|
57
|
+
)
|
|
58
|
+
return self._execute_request(session, params)
|
|
59
|
+
|
|
60
|
+
def type_text(
|
|
61
|
+
self,
|
|
62
|
+
session: Union[SessionDetail, str],
|
|
63
|
+
text: str,
|
|
64
|
+
return_screenshot: bool = False,
|
|
65
|
+
) -> ComputerActionResponse:
|
|
66
|
+
params = TypeTextActionParams(text=text, return_screenshot=return_screenshot)
|
|
67
|
+
return self._execute_request(session, params)
|
|
68
|
+
|
|
69
|
+
def screenshot(
|
|
70
|
+
self,
|
|
71
|
+
session: Union[SessionDetail, str],
|
|
72
|
+
) -> ComputerActionResponse:
|
|
73
|
+
params = ScreenshotActionParams()
|
|
74
|
+
return self._execute_request(session, params)
|
|
75
|
+
|
|
76
|
+
def press_keys(
|
|
77
|
+
self,
|
|
78
|
+
session: Union[SessionDetail, str],
|
|
79
|
+
keys: List[str],
|
|
80
|
+
return_screenshot: bool = False,
|
|
81
|
+
) -> ComputerActionResponse:
|
|
82
|
+
params = PressKeysActionParams(keys=keys, return_screenshot=return_screenshot)
|
|
83
|
+
return self._execute_request(session, params)
|
|
84
|
+
|
|
85
|
+
def drag(
|
|
86
|
+
self,
|
|
87
|
+
session: Union[SessionDetail, str],
|
|
88
|
+
path: List[Coordinate],
|
|
89
|
+
return_screenshot: bool = False,
|
|
90
|
+
) -> ComputerActionResponse:
|
|
91
|
+
params = DragActionParams(path=path, return_screenshot=return_screenshot)
|
|
92
|
+
return self._execute_request(session, params)
|
|
93
|
+
|
|
94
|
+
def move_mouse(
|
|
95
|
+
self,
|
|
96
|
+
session: Union[SessionDetail, str],
|
|
97
|
+
x: int,
|
|
98
|
+
y: int,
|
|
99
|
+
return_screenshot: bool = False,
|
|
100
|
+
) -> ComputerActionResponse:
|
|
101
|
+
params = MoveMouseActionParams(x=x, y=y, return_screenshot=return_screenshot)
|
|
102
|
+
return self._execute_request(session, params)
|
|
103
|
+
|
|
104
|
+
def scroll(
|
|
105
|
+
self,
|
|
106
|
+
session: Union[SessionDetail, str],
|
|
107
|
+
x: int,
|
|
108
|
+
y: int,
|
|
109
|
+
scroll_x: int,
|
|
110
|
+
scroll_y: int,
|
|
111
|
+
return_screenshot: bool = False,
|
|
112
|
+
) -> ComputerActionResponse:
|
|
113
|
+
params = ScrollActionParams(
|
|
114
|
+
x=x,
|
|
115
|
+
y=y,
|
|
116
|
+
scroll_x=scroll_x,
|
|
117
|
+
scroll_y=scroll_y,
|
|
118
|
+
return_screenshot=return_screenshot,
|
|
119
|
+
)
|
|
120
|
+
return self._execute_request(session, params)
|
|
@@ -11,6 +11,7 @@ from .managers.sync_manager.profile import ProfileManager
|
|
|
11
11
|
from .managers.sync_manager.scrape import ScrapeManager
|
|
12
12
|
from .managers.sync_manager.session import SessionManager
|
|
13
13
|
from .managers.sync_manager.team import TeamManager
|
|
14
|
+
from .managers.sync_manager.computer_action import ComputerActionManager
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class Hyperbrowser(HyperbrowserBase):
|
|
@@ -33,6 +34,7 @@ class Hyperbrowser(HyperbrowserBase):
|
|
|
33
34
|
self.extensions = ExtensionManager(self)
|
|
34
35
|
self.agents = Agents(self)
|
|
35
36
|
self.team = TeamManager(self)
|
|
37
|
+
self.computer_action = ComputerActionManager(self)
|
|
36
38
|
|
|
37
39
|
def close(self) -> None:
|
|
38
40
|
self.transport.close()
|
|
@@ -4,6 +4,7 @@ from .agents.browser_use import (
|
|
|
4
4
|
BrowserUseTaskStatusResponse,
|
|
5
5
|
StartBrowserUseTaskParams,
|
|
6
6
|
StartBrowserUseTaskResponse,
|
|
7
|
+
BrowserUseApiKeys,
|
|
7
8
|
)
|
|
8
9
|
from .agents.claude_computer_use import (
|
|
9
10
|
ClaudeComputerUseTaskData,
|
|
@@ -11,6 +12,7 @@ from .agents.claude_computer_use import (
|
|
|
11
12
|
ClaudeComputerUseTaskStatusResponse,
|
|
12
13
|
StartClaudeComputerUseTaskParams,
|
|
13
14
|
StartClaudeComputerUseTaskResponse,
|
|
15
|
+
ClaudeComputerUseApiKeys,
|
|
14
16
|
)
|
|
15
17
|
from .agents.cua import (
|
|
16
18
|
CuaTaskData,
|
|
@@ -18,6 +20,7 @@ from .agents.cua import (
|
|
|
18
20
|
CuaTaskStatusResponse,
|
|
19
21
|
StartCuaTaskParams,
|
|
20
22
|
StartCuaTaskResponse,
|
|
23
|
+
CuaApiKeys,
|
|
21
24
|
)
|
|
22
25
|
from .agents.hyper_agent import (
|
|
23
26
|
HyperAgentActionOutput,
|
|
@@ -29,6 +32,7 @@ from .agents.hyper_agent import (
|
|
|
29
32
|
HyperAgentTaskStatusResponse,
|
|
30
33
|
StartHyperAgentTaskParams,
|
|
31
34
|
StartHyperAgentTaskResponse,
|
|
35
|
+
HyperAgentApiKeys,
|
|
32
36
|
)
|
|
33
37
|
from .consts import (
|
|
34
38
|
ISO639_1,
|
|
@@ -88,6 +92,19 @@ from .scrape import (
|
|
|
88
92
|
StartScrapeJobParams,
|
|
89
93
|
StartScrapeJobResponse,
|
|
90
94
|
)
|
|
95
|
+
from .computer_action import (
|
|
96
|
+
ClickActionParams,
|
|
97
|
+
ComputerAction,
|
|
98
|
+
ComputerActionParams,
|
|
99
|
+
ComputerActionResponse,
|
|
100
|
+
Coordinate,
|
|
101
|
+
DragActionParams,
|
|
102
|
+
MoveMouseActionParams,
|
|
103
|
+
PressKeysActionParams,
|
|
104
|
+
ScreenshotActionParams,
|
|
105
|
+
ScrollActionParams,
|
|
106
|
+
TypeTextActionParams,
|
|
107
|
+
)
|
|
91
108
|
from .session import (
|
|
92
109
|
BasicResponse,
|
|
93
110
|
CreateSessionParams,
|
|
@@ -151,6 +168,10 @@ __all__ = [
|
|
|
151
168
|
"CuaTaskStatusResponse",
|
|
152
169
|
"StartCuaTaskParams",
|
|
153
170
|
"StartCuaTaskResponse",
|
|
171
|
+
"BrowserUseApiKeys",
|
|
172
|
+
"ClaudeComputerUseApiKeys",
|
|
173
|
+
"CuaApiKeys",
|
|
174
|
+
"HyperAgentApiKeys",
|
|
154
175
|
# crawl
|
|
155
176
|
"CrawledPage",
|
|
156
177
|
"CrawlJobResponse",
|
|
@@ -207,4 +228,16 @@ __all__ = [
|
|
|
207
228
|
"UploadFileResponse",
|
|
208
229
|
# team
|
|
209
230
|
"TeamCreditInfo",
|
|
231
|
+
# computer action
|
|
232
|
+
"ClickActionParams",
|
|
233
|
+
"ComputerAction",
|
|
234
|
+
"ComputerActionParams",
|
|
235
|
+
"ComputerActionResponse",
|
|
236
|
+
"Coordinate",
|
|
237
|
+
"DragActionParams",
|
|
238
|
+
"MoveMouseActionParams",
|
|
239
|
+
"PressKeysActionParams",
|
|
240
|
+
"ScreenshotActionParams",
|
|
241
|
+
"ScrollActionParams",
|
|
242
|
+
"TypeTextActionParams",
|
|
210
243
|
]
|
|
@@ -8,6 +8,20 @@ from ..session import CreateSessionParams
|
|
|
8
8
|
BrowserUseTaskStatus = Literal["pending", "running", "completed", "failed", "stopped"]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
class BrowserUseApiKeys(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
API keys for the browser use task.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
populate_by_alias=True,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
openai: Optional[str] = Field(default=None, serialization_alias="openai")
|
|
21
|
+
anthropic: Optional[str] = Field(default=None, serialization_alias="anthropic")
|
|
22
|
+
google: Optional[str] = Field(default=None, serialization_alias="google")
|
|
23
|
+
|
|
24
|
+
|
|
11
25
|
class StartBrowserUseTaskParams(BaseModel):
|
|
12
26
|
"""
|
|
13
27
|
Parameters for creating a new browser use task.
|
|
@@ -62,6 +76,12 @@ class StartBrowserUseTaskParams(BaseModel):
|
|
|
62
76
|
session_options: Optional[CreateSessionParams] = Field(
|
|
63
77
|
default=None, serialization_alias="sessionOptions"
|
|
64
78
|
)
|
|
79
|
+
use_custom_api_keys: Optional[bool] = Field(
|
|
80
|
+
default=None, serialization_alias="useCustomApiKeys"
|
|
81
|
+
)
|
|
82
|
+
api_keys: Optional[BrowserUseApiKeys] = Field(
|
|
83
|
+
default=None, serialization_alias="apiKeys"
|
|
84
|
+
)
|
|
65
85
|
|
|
66
86
|
|
|
67
87
|
class StartBrowserUseTaskResponse(BaseModel):
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/models/agents/claude_computer_use.py
RENAMED
|
@@ -10,6 +10,18 @@ ClaudeComputerUseTaskStatus = Literal[
|
|
|
10
10
|
]
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
class ClaudeComputerUseApiKeys(BaseModel):
|
|
14
|
+
"""
|
|
15
|
+
API keys for the Claude Computer Use task.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
model_config = ConfigDict(
|
|
19
|
+
populate_by_alias=True,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
anthropic: Optional[str] = Field(default=None, serialization_alias="anthropic")
|
|
23
|
+
|
|
24
|
+
|
|
13
25
|
class StartClaudeComputerUseTaskParams(BaseModel):
|
|
14
26
|
"""
|
|
15
27
|
Parameters for creating a new Claude Computer Use task.
|
|
@@ -30,6 +42,12 @@ class StartClaudeComputerUseTaskParams(BaseModel):
|
|
|
30
42
|
session_options: Optional[CreateSessionParams] = Field(
|
|
31
43
|
default=None, serialization_alias="sessionOptions"
|
|
32
44
|
)
|
|
45
|
+
use_custom_api_keys: Optional[bool] = Field(
|
|
46
|
+
default=None, serialization_alias="useCustomApiKeys"
|
|
47
|
+
)
|
|
48
|
+
api_keys: Optional[ClaudeComputerUseApiKeys] = Field(
|
|
49
|
+
default=None, serialization_alias="apiKeys"
|
|
50
|
+
)
|
|
33
51
|
|
|
34
52
|
|
|
35
53
|
class StartClaudeComputerUseTaskResponse(BaseModel):
|
|
@@ -7,6 +7,18 @@ from ..session import CreateSessionParams
|
|
|
7
7
|
CuaTaskStatus = Literal["pending", "running", "completed", "failed", "stopped"]
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
class CuaApiKeys(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
API keys for the CUA task.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
model_config = ConfigDict(
|
|
16
|
+
populate_by_alias=True,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
openai: Optional[str] = Field(default=None, serialization_alias="openai")
|
|
20
|
+
|
|
21
|
+
|
|
10
22
|
class StartCuaTaskParams(BaseModel):
|
|
11
23
|
"""
|
|
12
24
|
Parameters for creating a new CUA task.
|
|
@@ -26,6 +38,10 @@ class StartCuaTaskParams(BaseModel):
|
|
|
26
38
|
session_options: Optional[CreateSessionParams] = Field(
|
|
27
39
|
default=None, serialization_alias="sessionOptions"
|
|
28
40
|
)
|
|
41
|
+
use_custom_api_keys: Optional[bool] = Field(
|
|
42
|
+
default=None, serialization_alias="useCustomApiKeys"
|
|
43
|
+
)
|
|
44
|
+
api_keys: Optional[CuaApiKeys] = Field(default=None, serialization_alias="apiKeys")
|
|
29
45
|
|
|
30
46
|
|
|
31
47
|
class StartCuaTaskResponse(BaseModel):
|
|
@@ -8,6 +8,20 @@ from ..session import CreateSessionParams
|
|
|
8
8
|
HyperAgentTaskStatus = Literal["pending", "running", "completed", "failed", "stopped"]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
class HyperAgentApiKeys(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
API keys for the HyperAgent task.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
populate_by_alias=True,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
openai: Optional[str] = Field(default=None, serialization_alias="openai")
|
|
21
|
+
anthropic: Optional[str] = Field(default=None, serialization_alias="anthropic")
|
|
22
|
+
google: Optional[str] = Field(default=None, serialization_alias="google")
|
|
23
|
+
|
|
24
|
+
|
|
11
25
|
class StartHyperAgentTaskParams(BaseModel):
|
|
12
26
|
"""
|
|
13
27
|
Parameters for creating a new HyperAgent task.
|
|
@@ -27,6 +41,12 @@ class StartHyperAgentTaskParams(BaseModel):
|
|
|
27
41
|
session_options: Optional[CreateSessionParams] = Field(
|
|
28
42
|
default=None, serialization_alias="sessionOptions"
|
|
29
43
|
)
|
|
44
|
+
use_custom_api_keys: Optional[bool] = Field(
|
|
45
|
+
default=None, serialization_alias="useCustomApiKeys"
|
|
46
|
+
)
|
|
47
|
+
api_keys: Optional[HyperAgentApiKeys] = Field(
|
|
48
|
+
default=None, serialization_alias="apiKeys"
|
|
49
|
+
)
|
|
30
50
|
|
|
31
51
|
|
|
32
52
|
class StartHyperAgentTaskResponse(BaseModel):
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
from typing import List, Literal, Optional, Union
|
|
3
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ComputerAction(str, Enum):
|
|
7
|
+
"""Computer action types."""
|
|
8
|
+
|
|
9
|
+
CLICK = "click"
|
|
10
|
+
DRAG = "drag"
|
|
11
|
+
PRESS_KEYS = "press_keys"
|
|
12
|
+
MOVE_MOUSE = "move_mouse"
|
|
13
|
+
SCREENSHOT = "screenshot"
|
|
14
|
+
SCROLL = "scroll"
|
|
15
|
+
TYPE_TEXT = "type_text"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Coordinate(BaseModel):
|
|
19
|
+
"""Coordinate model for drag actions."""
|
|
20
|
+
|
|
21
|
+
x: int
|
|
22
|
+
y: int
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ClickActionParams(BaseModel):
|
|
26
|
+
"""Parameters for click action."""
|
|
27
|
+
|
|
28
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
29
|
+
|
|
30
|
+
action: Literal[ComputerAction.CLICK] = ComputerAction.CLICK
|
|
31
|
+
x: int
|
|
32
|
+
y: int
|
|
33
|
+
button: Literal["left", "right", "middle", "back", "forward", "wheel"] = Field(
|
|
34
|
+
default="left"
|
|
35
|
+
)
|
|
36
|
+
num_clicks: int = Field(serialization_alias="numClicks", default=1)
|
|
37
|
+
return_screenshot: bool = Field(
|
|
38
|
+
serialization_alias="returnScreenshot", default=False
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class DragActionParams(BaseModel):
|
|
43
|
+
"""Parameters for drag action."""
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
46
|
+
|
|
47
|
+
action: Literal[ComputerAction.DRAG] = ComputerAction.DRAG
|
|
48
|
+
path: List[Coordinate]
|
|
49
|
+
return_screenshot: bool = Field(
|
|
50
|
+
serialization_alias="returnScreenshot", default=False
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class PressKeysActionParams(BaseModel):
|
|
55
|
+
"""Parameters for press keys action."""
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
58
|
+
|
|
59
|
+
action: Literal[ComputerAction.PRESS_KEYS] = ComputerAction.PRESS_KEYS
|
|
60
|
+
keys: List[str]
|
|
61
|
+
return_screenshot: bool = Field(
|
|
62
|
+
serialization_alias="returnScreenshot", default=False
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class MoveMouseActionParams(BaseModel):
|
|
67
|
+
"""Parameters for move mouse action."""
|
|
68
|
+
|
|
69
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
70
|
+
|
|
71
|
+
action: Literal[ComputerAction.MOVE_MOUSE] = ComputerAction.MOVE_MOUSE
|
|
72
|
+
x: int = Field(ge=0)
|
|
73
|
+
y: int = Field(ge=0)
|
|
74
|
+
return_screenshot: bool = Field(
|
|
75
|
+
serialization_alias="returnScreenshot", default=False
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class ScreenshotActionParams(BaseModel):
|
|
80
|
+
"""Parameters for screenshot action."""
|
|
81
|
+
|
|
82
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
83
|
+
|
|
84
|
+
action: Literal[ComputerAction.SCREENSHOT] = ComputerAction.SCREENSHOT
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class ScrollActionParams(BaseModel):
|
|
88
|
+
"""Parameters for scroll action."""
|
|
89
|
+
|
|
90
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
91
|
+
|
|
92
|
+
action: Literal[ComputerAction.SCROLL] = ComputerAction.SCROLL
|
|
93
|
+
x: int
|
|
94
|
+
y: int
|
|
95
|
+
scroll_x: int = Field(serialization_alias="scrollX")
|
|
96
|
+
scroll_y: int = Field(serialization_alias="scrollY")
|
|
97
|
+
return_screenshot: bool = Field(
|
|
98
|
+
serialization_alias="returnScreenshot", default=False
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class TypeTextActionParams(BaseModel):
|
|
103
|
+
"""Parameters for type text action."""
|
|
104
|
+
|
|
105
|
+
model_config = ConfigDict(use_enum_values=True)
|
|
106
|
+
|
|
107
|
+
action: Literal[ComputerAction.TYPE_TEXT] = ComputerAction.TYPE_TEXT
|
|
108
|
+
text: str
|
|
109
|
+
return_screenshot: bool = Field(
|
|
110
|
+
serialization_alias="returnScreenshot", default=False
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
ComputerActionParams = Union[
|
|
115
|
+
ClickActionParams,
|
|
116
|
+
DragActionParams,
|
|
117
|
+
PressKeysActionParams,
|
|
118
|
+
MoveMouseActionParams,
|
|
119
|
+
ScreenshotActionParams,
|
|
120
|
+
ScrollActionParams,
|
|
121
|
+
TypeTextActionParams,
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class ComputerActionResponse(BaseModel):
|
|
126
|
+
"""Response from computer action API."""
|
|
127
|
+
|
|
128
|
+
model_config = ConfigDict(
|
|
129
|
+
populate_by_alias=True,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
success: bool
|
|
133
|
+
screenshot: Optional[str] = None
|
|
134
|
+
error: Optional[str] = None
|
|
135
|
+
message: Optional[str] = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from typing import Any, List, Literal, Optional, Union
|
|
3
|
+
from .computer_action import ComputerActionParams, ComputerActionResponse
|
|
3
4
|
|
|
4
5
|
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
5
6
|
|
|
@@ -64,6 +65,9 @@ class SessionDetail(Session):
|
|
|
64
65
|
)
|
|
65
66
|
|
|
66
67
|
ws_endpoint: Optional[str] = Field(alias="wsEndpoint", default=None)
|
|
68
|
+
computer_action_endpoint: Optional[str] = Field(
|
|
69
|
+
alias="computerActionEndpoint", default=None
|
|
70
|
+
)
|
|
67
71
|
live_url: str = Field(alias="liveUrl")
|
|
68
72
|
token: str = Field(alias="token")
|
|
69
73
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/agents/cua.py
RENAMED
|
File without changes
|
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/crawl.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/extension.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/extract.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/profile.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/scrape.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/session.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/async_manager/team.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/agents/cua.py
RENAMED
|
File without changes
|
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/crawl.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/extension.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/extract.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/profile.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/scrape.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/session.py
RENAMED
|
File without changes
|
{hyperbrowser-0.48.0 → hyperbrowser-0.50.0}/hyperbrowser/client/managers/sync_manager/team.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|