Skip to content

Commit 1ba3c56

Browse files
committed
release: v0.11.0 - TypeScript SDK, getCdpLink, session lifecycle, docs restructure
Breaking: - listMcpTools (Python): imageId now required (no silent default) Features: - TypeScript SDK: full client (Session, Code, FileSystem, Browser, Computer, etc.) - getCdpLink API (Python + TypeScript); Browser get_endpoint_url uses it - Session lifecycle: idle release timeout, refresh idle (keep-alive), resource_url 30min - BrowserAgent (TS): act, observe, extract, navigate; BrowserFingerprintGenerator - Python: call_mcp_tool in BaseService; Session._base_service - API reference: docs/api-reference/python/ + typescript/; Session docs split Enhancements: - FileSystem: FileInfo, FileChangeEvent, read bytes, write create_new, watchDir AbortSignal - Computer: MouseButton.DOUBLE_LEFT, drag(button); CursorPosition/ScreenSize; ignore_system_app - TS: requestId/getters, toJSON() for circular refs; Playwright-only screenshot - Project: Python SDK under python/; root README for Python + TypeScript Fixes: - MCP screenshot: extract type=image content; Extension OSS 403 (fetch); getCdpLink body/header - Docs: VitePress generics, dead links; CI path/subshell fixes; mypy/tsup Docs: quickstart, context, session lifecycle/info/labels/list/mcp-tools; browser-type, captcha, proxy Made-with: Cursor
1 parent ce24cae commit 1ba3c56

431 files changed

Lines changed: 87748 additions & 1449 deletions

File tree

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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ MANIFEST
3535
pip-log.txt
3636
pip-delete-this-directory.txt
3737

38+
# Dev temporary files (generated analysis, comparison docs, etc.)
39+
docs/dev/
40+
3841
# Unit test / coverage reports
3942
htmlcov/
43+
coverage/
4044
.tox/
4145
.nox/
4246
.coverage
@@ -136,3 +140,8 @@ CLAUDE.md
136140

137141
# uv lockfile (only used when using uv; project uses venv)
138142
uv.lock
143+
144+
# Node.js / TypeScript
145+
node_modules/
146+
*.tsbuildinfo
147+
.history/

CHANGES.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# Changelog
22

3+
## [0.11.0] - 2026-03-16
4+
5+
### Breaking Changes
6+
7+
- **listMcpTools (Python)**: Explicit `imageId` is now required (no silent default). Callers must pass `imageId` when listing MCP tools.
8+
9+
### New Features
10+
11+
- **TypeScript SDK**: Full TypeScript SDK for AGB (client, Session, Config, API layer, Command, Code, FileSystem, Browser, Computer, Extension, Context, exceptions, logger). API models split into 51 separate files.
12+
- **getCdpLink**: New API in Python and TypeScript; sessionId as query parameter. Browser `get_endpoint_url` uses getCdpLink in Python.
13+
- **BrowserAgent (TypeScript)**: `act`, `observe`, `extract`, `navigate`; async variants with time-based timeout; BrowserFingerprintGenerator and FingerprintFormat.
14+
- **Session lifecycle**: Idle release timeout (configurable); refresh session idle time API (keep-alive). Docs for lifecycle, keep-alive, and resource_url validity (30 min).
15+
- **Python**: `call_mcp_tool` delegated to BaseService to remove duplication; Session uses `_base_service`.
16+
- **Module parity (TypeScript)**: FileSystem upload/download via pre-signed URLs, `transferPath`, `watchDir`; Computer.Window fullscreen/focusMode; Computer.App `stopByCmd`/`getVisible`; Browser `getOption`/`isInitialized`; Session `getAgb()`; new file-transfer module for OSS and context sync.
17+
- **CI/CD**: TypeScript official release pipeline and script; npm build/publish pipeline; internal tnpm test publish; publish npm test to tnpm when patch is merged.
18+
- **Documentation**: Single root README (Python + TypeScript quick start, docs, development); website and Discord URLs; TypeScript code examples in VitePress code-group tabs; API reference merged into `docs/api-reference` with python/ and typescript/; Session docs split (lifecycle, info, labels, list, mcp-tools); Context expanded (concepts, best practices, FAQ); call-for-use and captcha docs.
19+
20+
### Enhancements
21+
22+
- **Filesystem (Python)**: FileInfo type; FileChangeEvent eventType/pathType; readFile with `{ format: "bytes" }`; writeFile `create_new` mode; watchDirectory with AbortSignal; sync fallback (awaitSync); waitForTask uses `res.items ?? res.contextStatusData`; OSS cleanup after upload/download. Unit tests aligned to DEFAULT_CHUNK_SIZE 50KB.
23+
- **Computer (Python/TS)**: MouseButton.DOUBLE_LEFT, drag(button); getPosition/getSize return CursorPosition/ScreenSize; get_installed_apps uses `ignore_system_app`. Browser: BrowserProxy managed type (user_id, isp, country, province, city).
24+
- **TypeScript**: Response models gained requestId and field parsing; getters (getTotalCount, getExpireTime, etc.); `toJSON()` on Session, AGB, BaseService, ContextService, ContextManager, Computer to avoid circular serialization; Browser screenshot Playwright-only (MCP screenshot removed); interface signatures aligned with Python (Keyboard press/release, App start/listInstalled, FileSystem progressCallback, Extension cleanup). `AGB.get()` returns `session: null` when session is deleted or missing (typed as `Session | null`).
25+
- **Project structure**: Python SDK moved under `python/` (agb/, tests/, pyproject.toml, etc.); CI, scripts, root README updated.
26+
27+
### Bug Fixes
28+
29+
- **MCP screenshot**: CallMcpToolResponse now extracts `type="image"` content when no text (screenshot tool returns image).
30+
- **Extension upload (TS)**: Use `fetch` instead of axios to fix 403 OSS upload.
31+
- **getCdpLink**: TypeScript sends empty JSON body and capitalized Authorization header; Python/TS tests fail explicitly instead of silent skip.
32+
- **Extension upload message (TS)**: Use `errorMessage` instead of `url` on failure.
33+
- **tsup (TS)**: Externalize playwright to fix ESM/CJS build (optional runtime dependency).
34+
- **Docs**: VitePress angle bracket escaping for TS generics; dead links fixed (tutorial depth, Related Resources, quickstart, browser links); tutorial link path generation for absolute-style paths; CI copy logic so api-reference/python/ does not get nested subdirs.
35+
- **Python**: mypy fixes (GetCdpLinkResponse, Browser/FileSystem __init__, Optional dicts, FileError duplicate, logging params, browser agent extract return types).
36+
- **CI**: Subshell `(cd python && ...)` to prevent path duplication; job outputs for pass/fail; summary decoupled from test jobs; correct image ID and AGB_ENDPOINT for TS integration tests; continue-on-error to avoid fast-fail cascade; clone retries and git HTTP tuning for push-docs-to-github.
37+
38+
### Documentation, Testing & Chore
39+
40+
- **Docs**: TypeScript API docs auto-generation in pipeline (TypeDoc); doc-metadata and computer overview generation (sub-modules before container, exclude_methods). Removed session best-practices.md, troubleshooting.md; keep-alive folded into lifecycle.
41+
- **Testing**: TypeScript unit tests (session, base-service, logger, api-response, command, code, filesystem, computer, browser, extension, context, context-manager, api models, http-client, client, file-transfer, agb, BrowserAgent, fingerprint); integration tests (all modules, browser, computer, file transfer, watchDir, MCP, advanced suites). Python unit coverage to ~83% (logger, code, computer submodules, file_system, context_manager); getCdpLink integration tests. Pre env uses agb-code-space-2; CICD script names optimized.
42+
- **Chore**: Removed unused session management methods and models; trimmed keep-alive use-case examples; docs/dev/ in .gitignore; code formatting (agb, browser). Pause and resume was added then removed in this cycle and is not part of the release.
43+
344
## [0.10.0] - 2026-02-09
445

546
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.

README.md

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</a>
66
</h4>
77

8+
---
9+
810
## 🔥 Moltbot (formerly Clawdbot) Quick Deployment
911

1012
You can use AGB SDK to spin up a prebuilt Moltbot cloud desktop in minutes, then open the Moltbot console inside the desktop browser.
@@ -17,25 +19,34 @@ You can use AGB SDK to spin up a prebuilt Moltbot cloud desktop in minutes, then
1719

1820
---
1921

20-
AGB Python SDK provides a convenient way to interact with the AGB cloud service.
22+
AGB Cloud SDK provides client libraries for interacting with the AGB cloud service.
2123

2224
## Features
2325

2426
- Create and manage sessions in the AGB cloud environment
25-
- Access session information
2627
- Work with file system, command execution, and code execution modules
2728
- Browser automation with AI-powered natural language operations
28-
- Advanced browser configuration (stealth mode, proxies, fingerprinting)
29-
- Structured data extraction from web pages
29+
- Persistent context management with sync policies
30+
31+
### 🎯 Scenario-Based Features
32+
- **Computer Use** - Linux computer control (mouse, keyboard, window, application, screen)
33+
- **Browser Use** - Web automation, scraping, and browser control
34+
- **CodeSpace** - Code execution and development environment
3035

3136
## Installation
3237

3338
```bash
39+
# Python
3440
pip install agbcloud-sdk
41+
42+
# TypeScript
43+
npm install agbcloud-sdk
3544
```
3645

3746
## Quick Start
3847

48+
### Python
49+
3950
```python
4051
from agb import AGB
4152
from agb.session_params import CreateSessionParams
@@ -71,6 +82,41 @@ else:
7182
print(f"Failed to create session: {result.error_message}")
7283
```
7384

85+
### TypeScript
86+
87+
```typescript
88+
import { AGB, CreateSessionParams } from "agbcloud-sdk";
89+
90+
// Initialize AGB with your API key
91+
const agb = new AGB({ apiKey: "your-api-key" });
92+
93+
// Create a session
94+
const params = new CreateSessionParams({ imageId: "agb-code-space-1" });
95+
const result = await agb.create(params);
96+
97+
if (result.success && result.session) {
98+
const session = result.session;
99+
100+
// Execute Python code
101+
const codeResult = await session.code.run("print('Hello AGB!')", "python");
102+
console.log(codeResult.results[0]?.text);
103+
104+
// Execute shell command
105+
const cmdResult = await session.command.execute("ls -la");
106+
console.log(cmdResult.stdout);
107+
108+
// Work with files
109+
await session.file.writeFile("/tmp/test.txt", "Hello World!");
110+
const fileResult = await session.file.readFile("/tmp/test.txt");
111+
console.log(fileResult.content);
112+
113+
// Clean up
114+
await agb.delete(session);
115+
} else {
116+
console.error(`Failed to create session: ${result.errorMessage}`);
117+
}
118+
```
119+
74120
## Documentation
75121

76122
For comprehensive documentation, guides, and examples, visit:
@@ -84,29 +130,33 @@ For comprehensive documentation, guides, and examples, visit:
84130

85131
## Development
86132

87-
### Prerequisites
133+
### Python
88134

89-
- Python 3.10 or higher
90-
- pip
135+
```bash
136+
cd python
137+
python -m venv .venv
138+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
139+
pip install -e ".[dev,test]"
140+
```
141+
142+
### TypeScript
91143

92-
### Setup
144+
```bash
145+
cd typescript
146+
npm install
147+
npm run build
148+
npm test
149+
```
93150

94-
1. Clone the repository:
95-
```bash
96-
git clone https://github.com/agbcloud/agbcloud-sdk.git
97-
cd agbcloud-sdk
98-
```
151+
## Get Help
152+
- [GitHub Issues](https://github.com/agbcloud/agbcloud-sdk/issues)
99153

100-
2. Create a virtual environment:
101-
```bash
102-
python -m venv venv
103-
source venv/bin/activate # On Windows: venv\Scripts\activate
104-
```
154+
## Contact
155+
Welcome to visit our product website and join our community!
105156

106-
3. Install dependencies:
107-
```bash
108-
pip install -e ."[dev,test]"
109-
```
157+
- **AGB Product Website**: [https://agb.cloud/](https://agb.cloud/)
158+
- **AGB Console**: [https://agb.cloud/console/overview](https://agb.cloud/console/overview)
159+
- **Discord Community**: [Join on Discord](https://discord.gg/WQ2EHJxhy7)
110160

111161
## License
112162

docs/README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,44 @@ Understanding the lifecycle of a session is crucial for resource management and
2525
3. **Timeout (Auto-Shutdown)**: Sessions are automatically reclaimed after **30 minutes** of inactivity by default to prevent runaway costs.
2626
4. **Deletion**: Explicitly deleting a session releases resources immediately.
2727

28-
```python
28+
::: code-group
29+
30+
```python [Python]
2931
from agb import AGB
3032
from agb.session_params import CreateSessionParams
3133

3234
agb = AGB()
3335

34-
# Example: Create a Code Execution Session
3536
code_params = CreateSessionParams(image_id="agb-code-space-1")
3637
result = agb.create(code_params)
3738

3839
if result.success:
3940
code_session = result.session
40-
4141
# ... perform operations ...
42-
43-
# Clean up
4442
agb.delete(code_session)
4543
else:
4644
print(f"Failed to create session: {result.error_message}")
4745
```
4846

47+
```typescript [TypeScript]
48+
import { AGB, CreateSessionParams } from "agbcloud-sdk";
49+
50+
const agb = new AGB();
51+
52+
const codeParams = new CreateSessionParams({ imageId: "agb-code-space-1" });
53+
const result = await agb.create(codeParams);
54+
55+
if (result.success && result.session) {
56+
const codeSession = result.session;
57+
// ... perform operations ...
58+
await agb.delete(codeSession);
59+
} else {
60+
console.error("Failed to create session:", result.errorMessage);
61+
}
62+
```
63+
64+
:::
65+
4966
### Key Capabilities
5067

5168
- **Labels**: Tag sessions with custom key-value pairs (e.g., `user_id`, `env`) for organization and filtering.

docs/api-key.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ There are two main ways to provide your API key:
1515

1616
## Examples
1717

18-
### Python
18+
::: code-group
1919

20-
```python
20+
```python [Python]
2121
# Method 1: Direct initialization with API key
2222
api_key = "your_api_key_here"
2323
agb = AGB(api_key=api_key)
@@ -28,6 +28,18 @@ agb = AGB(api_key=api_key)
2828
agb = AGB()
2929
```
3030

31+
```typescript [TypeScript]
32+
// Method 1: Direct initialization with API key
33+
const agb = new AGB({ apiKey: "your_api_key_here" });
34+
35+
// Method 2: Using environment variable
36+
// First, set the environment variable:
37+
// export AGB_API_KEY=your_api_key_here
38+
const agb2 = new AGB();
39+
```
40+
41+
:::
42+
3143
## Best Practices
3244

3345
1. **Environment Variables**: For production applications, it's recommended to use environment variables rather than hardcoding API keys in your code.

docs/api-reference/README.md

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,6 @@
1-
# AGB Python SDK API Reference
1+
# AGB SDK API Reference
22

3-
This directory is generated. Run `python scripts/generate_api_docs.py` to refresh it.
3+
API reference documentation for the AGB SDK, generated from source code.
44

5-
## Core
6-
7-
- `agb.md` – AGB
8-
- `session.md` – Session
9-
10-
## Capabilities
11-
12-
- `capabilities/shell_commands.md` – Command
13-
- `capabilities/file_system.md` – File System
14-
- `capabilities/code_execution.md` – Code
15-
- `capabilities/browser.md` – Browser
16-
- `capabilities/computer.md` – Computer
17-
18-
## Data Context
19-
20-
- `data_context/context.md` – Context
21-
- `data_context/context_manager.md` – Context Manager
22-
- `data_context/synchronization.md` – Synchronization
23-
24-
## Reference
25-
26-
- `reference/logging.md` – Logging
27-
- `reference/extensions.md` – Extension
28-
- `reference/configurations.md` – Configurations
29-
- `reference/exceptions.md` – Exceptions
30-
31-
## Reference & Types
32-
33-
- `reference/types.md` – Response Types & Schemas
34-
- `reference/exceptions.md` – SDK Exceptions
35-
- `reference/configurations.md` – Configuration Parameters
5+
- **[Python SDK API Reference](python/README.md)** – Generated from Python docstrings. Run `python scripts/generate_api_docs.py` to refresh.
6+
- **[TypeScript SDK API Reference](typescript/README.md)** – Generated with TypeDoc. Run `npm run docs:generate` from the `typescript` directory to refresh.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# AGB Python SDK API Reference
2+
3+
This directory is generated. Run `python scripts/generate_api_docs.py` to refresh it.
4+
5+
## Core
6+
7+
- `agb.md` – AGB
8+
- `session.md` – Session
9+
10+
## Capabilities
11+
12+
- `capabilities/shell_commands.md` – Command
13+
- `capabilities/file_system.md` – File System
14+
- `capabilities/code_execution.md` – Code
15+
- `capabilities/browser.md` – Browser
16+
- `capabilities/computer.md` – Computer
17+
18+
## Data Context
19+
20+
- `data_context/context.md` – Context
21+
- `data_context/context_manager.md` – Context Manager
22+
- `data_context/synchronization.md` – Synchronization
23+
24+
## Reference
25+
26+
- `reference/logging.md` – Logging
27+
- `reference/extensions.md` – Extension
28+
- `reference/configurations.md` – Configurations
29+
- `reference/exceptions.md` – Exceptions
30+
31+
## Reference & Types
32+
33+
- `reference/types.md` – Response Types & Schemas
34+
- `reference/exceptions.md` – SDK Exceptions
35+
- `reference/configurations.md` – Configuration Parameters
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Related Tutorial
44

5-
- [Quick Start Guide](../quickstart.md) - Get started with the AGB Python SDK
5+
- [Quick Start Guide](../../quickstart.md) - Get started with the AGB Python SDK
66

77
## Overview
88

0 commit comments

Comments
 (0)