Skip to content

Commit f555636

Browse files
release: v0.10.0 - Computer API Phase 2, policy_id, OpenClaw examples
Breaking: - Computer: flat API → submodules (mouse, keyboard, screen, window, app) - Remove legacy agb/modules/computer.py; add agb/modules/computer/* Features: - CreateSessionParams.policy_id / mcpPolicyId for policy-scoped sessions - OpenClaw: Slack, Discord, Telegram config examples; remove generic example Enhancements: - API call log level info→debug; aiohttp certifi SSL; screenshot retry - Screen result parsing; app/window error handling; keyboard combo lowercase Docs & tests: - Computer docs and API reference updated; script cleanup (doc-gen, run_real_tests) - Browser fingerprint and computer integration tests; Playwright connect test - Website host → agb.cloud Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 678f003 commit f555636

54 files changed

Lines changed: 4360 additions & 5650 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ dmypy.json
134134
CLAUDE.md
135135
.DS_Store
136136

137-
.history/API命名优化-执行清单.md
138-
API命名优化-执行清单.md
137+
# uv lockfile (only used when using uv; project uses venv)
138+
uv.lock

CHANGES.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
# Changelog
22

3+
## [0.10.0] - 2026-02-09
4+
5+
This release focuses on **API Naming Simplification Phase 2** in the Computer module, the new **policy_id** parameter for session creation, and **OpenClaw examples** for Slack, Discord, and Telegram.
6+
7+
### Breaking Changes
8+
9+
- **API Naming Simplification Phase 2 (Computer Module)**: Interfaces previously flat in `session.computer` are now organized by sub-module (`mouse`, `keyboard`, `screen`, `window`, `app`). The legacy single `computer.py` has been removed. API mapping:
10+
- `session.computer.click_mouse(x, y)``session.computer.mouse.click(x, y)`
11+
- `session.computer.move_mouse(x, y)``session.computer.mouse.move(x, y)`
12+
- `session.computer.drag_mouse(x1, y1, x2, y2)``session.computer.mouse.drag(x1, y1, x2, y2)`
13+
- `session.computer.scroll(x, y, direction, amount)``session.computer.mouse.scroll(x, y, direction, amount)`
14+
- `session.computer.get_cursor_position()``session.computer.mouse.get_position()`
15+
- `session.computer.input_text(text)``session.computer.keyboard.type(text)`
16+
- `session.computer.press_keys(keys)``session.computer.keyboard.press(keys)`
17+
- `session.computer.release_keys(keys)``session.computer.keyboard.release(keys)`
18+
- `session.computer.list_root_windows()``session.computer.window.list_root_windows()`
19+
- `session.computer.get_active_window()``session.computer.window.get_active_window()`
20+
- `session.computer.activate_window(window_id)``session.computer.window.activate(window_id)`
21+
- `session.computer.close_window(window_id)``session.computer.window.close(window_id)`
22+
- `session.computer.maximize_window(window_id)``session.computer.window.maximize(window_id)`
23+
- `session.computer.minimize_window(window_id)``session.computer.window.minimize(window_id)`
24+
- `session.computer.restore_window(window_id)``session.computer.window.restore(window_id)`
25+
- `session.computer.resize_window(window_id, w, h)``session.computer.window.resize(window_id, w, h)`
26+
- `session.computer.fullscreen_window(window_id)``session.computer.window.fullscreen(window_id)`
27+
- `session.computer.focus_mode(on=True)``session.computer.window.focus_mode(on=True)`
28+
- `session.computer.get_installed_apps()``session.computer.app.list_installed()`
29+
- `session.computer.list_visible_apps()``session.computer.app.get_visible()`
30+
- `session.computer.start_app(name)``session.computer.app.start(name)`
31+
- `session.computer.stop_app_by_pname(pname)``session.computer.app.stop_by_pname(pname)`
32+
- `session.computer.stop_app_by_pid(pid)``session.computer.app.stop_by_pid(pid)`
33+
- `session.computer.stop_app_by_cmd(stop_cmd)``session.computer.app.stop_by_cmd(stop_cmd)`
34+
- `session.computer.get_screen_size()``session.computer.screen.get_size()`
35+
- `session.computer.screenshot()``session.computer.screen.capture()`
36+
- Implementation aligned with original behavior: unified log operation names, restored return types, and corrected mouse button validation and screen capture return types.
37+
38+
### New Features
39+
40+
- **policy_id**: `CreateSessionParams` adds `policy_id`; the create-session request supports `mcpPolicyId` for policy-scoped sessions.
41+
- **OpenClaw examples**: Three example configurations for IM integrations:
42+
- **Slack** – configuration and usage with OpenClaw
43+
- **Discord** – configuration and usage with OpenClaw
44+
- **Telegram** – configuration and usage with OpenClaw (including README mention)
45+
46+
### Other Enhancements
47+
48+
- API call log level changed from info to debug
49+
- aiohttp uses certifi for SSL context (macOS/Windows)
50+
- Screenshot examples add retry and better SSL error handling
51+
- Screen module: improved `result.data` parsing for string and dict
52+
- App/window error handling improved; `get_active_window` raises `RuntimeError` on failure; window JSON errors return None
53+
54+
### Bug Fixes
55+
56+
- Added missing `request_id` on `AppOperationResult` / `ApplicationManager`
57+
- Fixed example indentation and return types (`app.start()`, `screen.capture()`)
58+
- Keyboard `combo` letter keys normalized to lowercase
59+
- Fixed pytest imports (pythonpath, project root, `functional_helpers`)
60+
- Integration test fixes for `list_installed`, cursor validation, scroll API, and `window_operations.py` app selection
61+
62+
### Documentation, Testing & Chore
63+
64+
- Docs auto-generated and aligned with 26 API specification; example formatting and comments updated.
65+
- Browser fingerprint and computer integration tests improved; timeout test for 1s minimum; added Playwright connect test.
66+
- Website host changed to agb.cloud.
67+
368
## [0.9.0] - 2026-01-23
469

570
### Breaking Changes
@@ -154,7 +219,7 @@
154219
- Added integration test job to CI/CD pipeline with comprehensive test coverage
155220
- Improved test stability with proper wait times and resource cleanup
156221
- Added CI bot guard to prevent infinite loops and enhanced error detection
157-
- Fixed AONE documentation pipeline configuration and optimized documentation workflow
222+
- Fixed documentation pipeline configuration and optimized documentation workflow
158223

159224
## [0.5.0] - 2025-11-20
160225

agb/agb.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ def create(self, params: Optional[CreateSessionParams] = None) -> SessionResult:
164164
request = CreateSessionRequest(authorization=f"Bearer {self.api_key}")
165165
request.image_id = params.image_id
166166

167+
# Add policy_id if provided
168+
if params.policy_id:
169+
request.mcp_policy_id = params.policy_id
170+
167171
# Add labels if provided
168172
if params.labels:
169173
# Convert labels to JSON string
@@ -191,12 +195,6 @@ def create(self, params: Optional[CreateSessionParams] = None) -> SessionResult:
191195

192196
response: CreateSessionResponse = self.client.create_mcp_session(request)
193197

194-
try:
195-
logger.info("Response body:")
196-
logger.info(response.to_dict())
197-
except Exception:
198-
logger.info(f"Response: {response}")
199-
200198
# Extract request ID
201199
request_id_attr = getattr(response, "request_id", "")
202200
request_id = request_id_attr or ""
@@ -228,6 +226,9 @@ def create(self, params: Optional[CreateSessionParams] = None) -> SessionResult:
228226

229227
logger.info(f"session_id = {session_id}")
230228
logger.info(f"resource_url = {resource_url}")
229+
if response.data:
230+
logger.info(f"appInstanceId = {response.data.app_instance_id}" )
231+
logger.info(f"resourceId = {response.data.resource_id}")
231232

232233
# Create Session object
233234
session = Session(self, session_id)

0 commit comments

Comments
 (0)