Skip to content

Commit a9847aa

Browse files
Merge pull request #246 from askui/integrate-agent-os-package
refactor(askui): delegate controller path to askui-agent-os package
2 parents 9dac0c3 + 513e9a5 commit a9847aa

5 files changed

Lines changed: 41 additions & 557 deletions

File tree

docs/01_setup.md

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -23,63 +23,6 @@ If you want a minimal installation without optional dependencies, please run
2323
pip install askui
2424
```
2525

26-
## AgentOS Installation
27-
28-
AgentOS is a device controller that allows agents to take screenshots, move the mouse, click, type on the keyboard, interact with the shell, and manage user session across any operating system. It's installed on a Desktop OS but can also control mobile devices and HMI devices when connected.
29-
30-
### Windows
31-
32-
- [Download AskUI Installer for AMD64](https://files.askui.com/releases/Installer/Latest/AskUI-Suite-Latest-User-Installer-Win-AMD64-Web.exe)
33-
- [Download AskUI Installer for ARM64](https://files.askui.com/releases/Installer/Latest/AskUI-Suite-Latest-User-Installer-Win-ARM64-Web.exe)
34-
35-
**Installation Steps:**
36-
1. Download the installer for your architecture
37-
2. Run the executable
38-
3. Follow the installation wizard
39-
4. AgentOS will start automatically after installation
40-
41-
### Linux
42-
43-
**⚠️ Important:** AgentOS currently does not work on Wayland. Switch to XOrg to use it.
44-
45-
#### AMD64 (Intel/AMD Processors)
46-
47-
```bash
48-
curl -L -o /tmp/AskUI-Suite-Latest-User-Installer-Linux-AMD64-Web.run https://files.askui.com/releases/Installer/Latest/AskUI-Suite-Latest-User-Installer-Linux-AMD64-Web.run
49-
bash /tmp/AskUI-Suite-Latest-User-Installer-Linux-AMD64-Web.run
50-
```
51-
52-
#### ARM64 (ARM Processors)
53-
54-
```bash
55-
curl -L -o /tmp/AskUI-Suite-Latest-User-Installer-Linux-ARM64-Web.run https://files.askui.com/releases/Installer/Latest/AskUI-Suite-Latest-User-Installer-Linux-ARM64-Web.run
56-
bash /tmp/AskUI-Suite-Latest-User-Installer-Linux-ARM64-Web.run
57-
```
58-
59-
**Installation Steps:**
60-
1. Download the installer script
61-
2. Run the script with bash
62-
3. Follow the prompts
63-
4. AgentOS will start automatically after installation
64-
65-
### MacOS
66-
67-
**⚠️ Important:** AgentOS currently does not work on MacOS with Intel chips (x86_64/amd64 architecture). You need a Mac with Apple Silicon (M1, M2, M3, etc.).
68-
69-
#### ARM64 (Apple Silicon)
70-
71-
```bash
72-
curl -L -o /tmp/AskUI-Suite-Latest-User-Installer-MacOS-ARM64-Web.run https://files.askui.com/releases/Installer/Latest/AskUI-Suite-Latest-User-Installer-MacOS-ARM64-Web.run
73-
bash /tmp/AskUI-Suite-Latest-User-Installer-MacOS-ARM64-Web.run
74-
```
75-
76-
**Installation Steps:**
77-
1. Download the installer script
78-
2. Run the script with bash
79-
3. Follow the prompts
80-
4. Grant necessary permissions when prompted (screen recording, accessibility)
81-
5. AgentOS will start automatically after installation
82-
8326
## Authentication and Configuration
8427

8528
To use the AskUI VisionAgent, please sign up and configure your credentials.
@@ -125,13 +68,6 @@ set ASKUI_WORKSPACE_ID=<your-workspace-id-here>
12568
set ASKUI_TOKEN=<your-token-here>
12669
```
12770

128-
#### AskUI Shell
129-
_Note: The AskUI Shell can be installed using the AskUI Suite_
130-
```powershell
131-
askui-shell
132-
AskUI-SetSetting -WorkspaceId <your-workspace-id-here> -Token <your-token-here>
133-
```
134-
13571
## Verifying Your Installation
13672

13773
```python

pdm.lock

Lines changed: 35 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = [
55
{name = "askui GmbH", email = "info@askui.com"},
66
]
77
dependencies = [
8+
"askui-agent-os>=26.1.1",
89
"anthropic>=0.72.0",
910
"fastapi>=0.115.12",
1011
"fastmcp>=2.3.0",
Lines changed: 2 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pathlib
2-
import sys
32
from functools import cached_property
43

4+
from askui_agent_os import AgentOS
55
from pydantic import BaseModel, Field, field_validator
66
from pydantic_settings import BaseSettings, SettingsConfigDict
77

@@ -32,21 +32,6 @@ class AskUiControllerSettings(BaseSettings):
3232
env_prefix="ASKUI_",
3333
)
3434

35-
component_registry_file: pathlib.Path | None = None
36-
installation_directory: pathlib.Path | None = Field(
37-
None,
38-
deprecated="ASKUI_INSTALLATION_DIRECTORY has been deprecated in favor of "
39-
"ASKUI_COMPONENT_REGISTRY_FILE and ASKUI_CONTROLLER_PATH. You may be using an "
40-
"outdated AskUI Suite. If you think so, reinstall to upgrade the AskUI Suite "
41-
"(see https://docs.askui.com/01-tutorials/00-installation).",
42-
)
43-
controller_path_setting: pathlib.Path | None = Field(
44-
None,
45-
validation_alias="ASKUI_CONTROLLER_PATH",
46-
description="Path to the AskUI Remote Device Controller executable. Takes "
47-
"precedence over ASKUI_COMPONENT_REGISTRY_FILE and ASKUI_INSTALLATION_DIRECTORY"
48-
".",
49-
)
5035
controller_args: str | None = Field(
5136
default="--showOverlay false",
5237
description=(
@@ -92,89 +77,9 @@ def validate_controller_args(cls, value: str) -> str:
9277

9378
return value
9479

95-
def _find_remote_device_controller_by_installation_directory(
96-
self,
97-
) -> pathlib.Path | None:
98-
if self.installation_directory is None:
99-
return None
100-
101-
return self._build_controller_path(self.installation_directory)
102-
103-
def _build_controller_path(
104-
self, installation_directory: pathlib.Path
105-
) -> pathlib.Path:
106-
match sys.platform:
107-
case "win32":
108-
return (
109-
installation_directory
110-
/ "Binaries"
111-
/ "resources"
112-
/ "assets"
113-
/ "binaries"
114-
/ "AskuiRemoteDeviceController.exe"
115-
)
116-
case "darwin":
117-
return (
118-
installation_directory
119-
/ "Binaries"
120-
/ "askui-ui-controller.app"
121-
/ "Contents"
122-
/ "Resources"
123-
/ "assets"
124-
/ "binaries"
125-
/ "AskuiRemoteDeviceController"
126-
)
127-
case "linux":
128-
return (
129-
installation_directory
130-
/ "Binaries"
131-
/ "resources"
132-
/ "assets"
133-
/ "binaries"
134-
/ "AskuiRemoteDeviceController"
135-
)
136-
case _:
137-
error_msg = (
138-
f'Platform "{sys.platform}" not supported by '
139-
"AskUI Remote Device Controller"
140-
)
141-
raise NotImplementedError(error_msg)
142-
143-
def _find_remote_device_controller_by_component_registry_file(
144-
self,
145-
) -> pathlib.Path | None:
146-
if self.component_registry_file is None:
147-
return None
148-
149-
component_registry = AskUiComponentRegistry.model_validate_json(
150-
self.component_registry_file.read_text(encoding="utf-8")
151-
)
152-
return (
153-
component_registry.installed_packages.remote_device_controller_uuid.executables.askui_remote_device_controller # noqa: E501
154-
)
155-
15680
@cached_property
15781
def controller_path(self) -> pathlib.Path:
158-
result = (
159-
self.controller_path_setting
160-
or self._find_remote_device_controller_by_component_registry_file()
161-
or self._find_remote_device_controller_by_installation_directory()
162-
)
163-
if result is None:
164-
error_msg = (
165-
"No AskUI Remote Device Controller found. Please set the "
166-
"ASKUI_COMPONENT_REGISTRY_FILE, ASKUI_INSTALLATION_DIRECTORY, or "
167-
"ASKUI_CONTROLLER_PATH environment variable."
168-
)
169-
raise ValueError(error_msg)
170-
171-
if not result.is_file():
172-
error_msg = (
173-
"AskUIRemoteDeviceController executable does not exist under "
174-
f"`{result}`"
175-
)
176-
raise FileNotFoundError(error_msg)
177-
return result
82+
return AgentOS.controller_path()
17883

17984

18085
__all__ = ["AskUiControllerSettings"]

0 commit comments

Comments
 (0)