computer-agents 0.4.11 → 0.5.1

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.
package/README.md CHANGED
@@ -64,11 +64,14 @@ const result = await run(agent, "Create a Python script that calculates fibonacc
64
64
  console.log(result.finalOutput);
65
65
  ```
66
66
 
67
- ### Cloud Computer Agent (with workspace sync)
67
+ ### Cloud Computer Agent (Coming Soon)
68
+
69
+ > **Note**: CloudRuntime for remote execution is under development and will be available in an upcoming release. The infrastructure is production-ready, and we're finalizing API access for public use.
68
70
 
69
71
  ```typescript
70
72
  import { Agent, run, CloudRuntime } from 'computer-agents';
71
73
 
74
+ // CloudRuntime will be available soon
72
75
  const agent = new Agent({
73
76
  agentType: "computer",
74
77
  runtime: new CloudRuntime({ apiKey: process.env.TESTBASE_API_KEY }),
@@ -81,25 +84,7 @@ console.log(result.finalOutput);
81
84
  // Files automatically synced from cloud to local workspace
82
85
  ```
83
86
 
84
- ### Cloud-Only Mode (no local sync)
85
-
86
- Perfect for CI/CD, experiments, and parallel tasks:
87
-
88
- ```typescript
89
- const runtime = new CloudRuntime({
90
- apiKey: process.env.TESTBASE_API_KEY,
91
- skipWorkspaceSync: true, // No upload/download, faster execution
92
- });
93
-
94
- const agent = new Agent({
95
- agentType: "computer",
96
- runtime,
97
- workspace: "./cloud-workspace", // Placeholder, not synced
98
- });
99
-
100
- const result = await run(agent, "Build a REST API with Express");
101
- // Executes in fresh cloud workspace, results stay in cloud
102
- ```
87
+ For now, use `LocalRuntime` for all computer agent tasks.
103
88
 
104
89
  ### Streaming Progress (Real-Time Visibility)
105
90
 
@@ -162,26 +147,92 @@ for await (const event of runStreamed(agent, task)) {
162
147
  }
163
148
  ```
164
149
 
165
- ### Parallel Execution (The Game Changer)
150
+ ### Project Management (Efficient Workspace Sync)
151
+
152
+ Manage workspaces with the new Project API - perfect for organizing code and syncing with cloud storage:
153
+
154
+ ```typescript
155
+ import { Project, CloudRuntime, Agent, run } from 'computer-agents';
156
+
157
+ const runtime = new CloudRuntime({ apiKey: process.env.TESTBASE_API_KEY });
158
+
159
+ // Create a synced project (local ↔ cloud)
160
+ const project = await Project.create({
161
+ name: 'my-app',
162
+ type: 'synced', // 'local', 'cloud', or 'synced'
163
+ localPath: './src',
164
+ runtime
165
+ });
166
+
167
+ // Incremental sync - only uploads changed files (10x faster!)
168
+ await project.sync({ direction: 'up' }); // Upload changes
169
+ await project.sync({ direction: 'down' }); // Download changes
170
+ await project.sync({ direction: 'both' }); // Bi-directional sync
171
+
172
+ // Agents automatically use project workspaces
173
+ const agent = new Agent({
174
+ agentType: 'computer',
175
+ runtime,
176
+ workspace: project.getWorkspacePath()
177
+ });
178
+
179
+ await run(agent, 'Add user authentication');
180
+ // Changes are tracked, next sync will be incremental!
181
+ ```
182
+
183
+ **Project Types:**
184
+ - **`local`** - Local-only workspace (no cloud sync)
185
+ - **`cloud`** - Cloud-only workspace (no local files)
186
+ - **`synced`** - Bidirectional sync with incremental updates
187
+
188
+ **Key Benefits:**
189
+ - **10x faster sync** - Only transfers changed files (SHA-256 hashing)
190
+ - **Organized workspaces** - Manage multiple projects easily
191
+ - **Automatic tracking** - Sync state persisted in `.testbase/sync-state.json`
192
+ - **Flexible sync** - Choose `up`, `down`, or `both` directions
193
+
194
+ **Example: Incremental Sync Performance**
195
+ - Full workspace (500MB): ~35 seconds
196
+ - Incremental (5MB changes): ~3 seconds
197
+
198
+ ```typescript
199
+ // List all projects
200
+ const projects = await Project.list({ runtime });
201
+
202
+ // Get existing project
203
+ const project = await Project.get('project-id', { runtime });
204
+
205
+ // Get sync statistics
206
+ const stats = await project.getSyncStats();
207
+ console.log(stats); // { lastSyncAt, fileCount, version }
208
+
209
+ // Manual file operations
210
+ await project.upload(['file1.txt', 'file2.txt']);
211
+ await project.download(['file1.txt']);
212
+ await project.readFile('config.json');
213
+ await project.writeFile('config.json', '{ "new": "data" }');
214
+ ```
215
+
216
+ > **Note**: Project Management with CloudRuntime is coming soon. Currently works with LocalRuntime for local workspace organization.
217
+
218
+ ### Parallel Execution (Coming Soon with CloudRuntime)
166
219
 
167
- Run multiple agents simultaneously:
220
+ > **Note**: Large-scale parallel execution requires CloudRuntime, which is coming soon. For now, you can run multiple LocalRuntime agents in parallel for local development.
221
+
222
+ When CloudRuntime is available, run 10, 50, or 100+ agents simultaneously:
168
223
 
169
224
  ```typescript
170
225
  import { Agent, run, CloudRuntime } from 'computer-agents';
171
226
 
227
+ // CloudRuntime will enable massive parallelization
172
228
  const runtime = new CloudRuntime({
173
229
  apiKey: process.env.TESTBASE_API_KEY,
174
230
  skipWorkspaceSync: true,
175
231
  });
176
232
 
177
233
  // Create 5 agents to test different approaches
178
- const agents = [
179
- 'Express',
180
- 'Fastify',
181
- 'Koa',
182
- 'Hapi',
183
- 'Restify'
184
- ].map(framework => new Agent({
234
+ const frameworks = ['Express', 'Fastify', 'Koa', 'Hapi', 'Restify'];
235
+ const agents = frameworks.map(framework => new Agent({
185
236
  name: `${framework} Agent`,
186
237
  agentType: 'computer',
187
238
  runtime,
@@ -198,6 +249,22 @@ const results = await Promise.all(
198
249
  console.log('All 5 frameworks tested in parallel!');
199
250
  ```
200
251
 
252
+ **For now with LocalRuntime:**
253
+ ```typescript
254
+ // You can still run multiple LocalRuntime agents in parallel
255
+ // (limited by your local machine resources)
256
+ const localAgents = frameworks.map(framework => new Agent({
257
+ agentType: 'computer',
258
+ runtime: new LocalRuntime(),
259
+ workspace: `./local-test-${framework.toLowerCase()}`,
260
+ }));
261
+
262
+ // Parallel local execution
263
+ const results = await Promise.all(
264
+ localAgents.map((agent, i) => run(agent, tasks[i]))
265
+ );
266
+ ```
267
+
201
268
  ### LLM Agent (for planning and reasoning)
202
269
 
203
270
  ```typescript
@@ -519,6 +586,8 @@ class LocalRuntime implements Runtime {
519
586
 
520
587
  ### CloudRuntime
521
588
 
589
+ > **Note**: CloudRuntime is under development and will be available in an upcoming release.
590
+
522
591
  ```typescript
523
592
  class CloudRuntime implements Runtime {
524
593
  constructor(config?: {
@@ -534,6 +603,60 @@ class CloudRuntime implements Runtime {
534
603
  }
535
604
  ```
536
605
 
606
+ ### Project
607
+
608
+ ```typescript
609
+ class Project {
610
+ // Factory methods
611
+ static async create(config: CreateProjectConfig): Promise<Project>;
612
+ static async get(id: string, config: GetProjectConfig): Promise<Project>;
613
+ static async list(config: GetProjectConfig): Promise<Project[]>;
614
+
615
+ // Properties
616
+ readonly id: string;
617
+ readonly name: string;
618
+ readonly type: 'local' | 'cloud' | 'synced';
619
+ readonly localPath: string | undefined;
620
+ readonly cloudPath: string;
621
+
622
+ // Sync operations
623
+ async sync(options?: SyncOptions): Promise<SyncResult>;
624
+ async upload(files: string[]): Promise<void>;
625
+ async download(files: string[]): Promise<void>;
626
+
627
+ // File operations
628
+ async listFiles(pattern?: string): Promise<ProjectFile[]>;
629
+ async readFile(path: string): Promise<string>;
630
+ async writeFile(path: string, content: string): Promise<void>;
631
+
632
+ // Management
633
+ async delete(hard?: boolean): Promise<void>;
634
+ async getStats(): Promise<ProjectStats>;
635
+ async getSyncStats(): Promise<SyncStats>;
636
+ async resetSyncState(): Promise<void>;
637
+
638
+ // Workspace path for agents
639
+ getWorkspacePath(): string;
640
+ }
641
+
642
+ // Create project
643
+ const project = await Project.create({
644
+ name: 'my-app',
645
+ type: 'synced', // 'local' | 'cloud' | 'synced'
646
+ localPath: './src', // Required for 'local' and 'synced'
647
+ runtime, // Required for 'cloud' and 'synced'
648
+ description: 'My app', // Optional
649
+ metadata: { ... }, // Optional
650
+ });
651
+
652
+ // Sync options
653
+ await project.sync({
654
+ direction: 'both', // 'up' | 'down' | 'both'
655
+ force: false, // Force full sync (skip incremental)
656
+ pattern: '*.ts' // Optional glob pattern
657
+ });
658
+ ```
659
+
537
660
  ## Architecture
538
661
 
539
662
  ```
@@ -625,15 +748,20 @@ for (let i = 0; i < agents.length; i++) {
625
748
 
626
749
  ## Cloud Infrastructure
627
750
 
628
- computer-agents includes production-ready cloud infrastructure:
751
+ > **Coming Soon**: Public access to cloud execution infrastructure is under development.
752
+
753
+ computer-agents includes production-ready cloud infrastructure that will soon be available:
629
754
 
630
755
  - **GCS Bucket** - Workspace storage (`gs://testbase-workspaces`)
631
756
  - **GCE VM** - Codex SDK execution server
632
757
  - **Pay-per-token** - Credit-based billing system
633
758
  - **API Keys** - Database-backed authentication
634
759
  - **Budget Protection** - Daily/monthly spending limits
760
+ - **Project Management** - Incremental sync with SHA-256 hashing
761
+
762
+ The infrastructure is fully built and tested. We're finalizing API access for public use. Stay tuned for updates!
635
763
 
636
- See [Cloud Infrastructure docs](./packages/cloud-infrastructure/README.md) for deployment details.
764
+ For now, `LocalRuntime` provides full computer-use agent capabilities for local development.
637
765
 
638
766
  ## Documentation
639
767
 
@@ -666,6 +794,15 @@ new CloudRuntime({ skipWorkspaceSync: true })
666
794
 
667
795
  ## What's New
668
796
 
797
+ ### v0.5.0
798
+ - **Project Management System**: Organize and sync workspaces efficiently
799
+ - Three project types: `local`, `cloud`, and `synced`
800
+ - Incremental sync with SHA-256 hashing - 10x faster than full sync
801
+ - Track sync state automatically in `.testbase/sync-state.json`
802
+ - Native Web API FormData for reliable file uploads
803
+ - Seamless agent integration with project workspaces
804
+ - Complete API: `Project.create()`, `project.sync()`, `project.upload()`, `project.download()`
805
+
669
806
  ### v0.4.9
670
807
  - **Streaming Progress**: New `runStreamed()` function for real-time visibility
671
808
  - Stream events: thread.started, turn.started, item.completed, turn.completed
package/dist/metadata.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.METADATA = void 0;
5
5
  exports.METADATA = {
6
6
  "name": "computer-agents",
7
- "version": "0.4.11",
7
+ "version": "0.5.1",
8
8
  "versions": {
9
- "computer-agents": "0.4.11"
9
+ "computer-agents": "0.5.1"
10
10
  }
11
11
  };
12
12
  exports.default = exports.METADATA;
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":";AACA,uCAAuC;;;AAE1B,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,iBAAiB;IACzB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,iBAAiB,EAAE,QAAQ;KAC5B;CACF,CAAC;AAEF,kBAAe,gBAAQ,CAAC"}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":";AACA,uCAAuC;;;AAE1B,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,iBAAiB;IACzB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE;QACV,iBAAiB,EAAE,OAAO;KAC3B;CACF,CAAC;AAEF,kBAAe,gBAAQ,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "computer-agents",
3
3
  "repository": "https://github.com/TestBase-ai/computer-agents",
4
4
  "homepage": "https://testbase.ai/computer-agents",
5
- "version": "0.4.11",
5
+ "version": "0.5.1",
6
6
  "description": "Build computer-use agents that write code, run tests, and deploy apps. Seamless local and cloud execution with automatic session continuity.",
7
7
  "author": "Testbase",
8
8
  "main": "dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "build-check": "tsc --noEmit -p ./tsconfig.test.json"
21
21
  },
22
22
  "dependencies": {
23
- "computer-agents-core": "0.4.11",
24
- "computer-agents-openai": "0.4.11"
23
+ "computer-agents-core": "0.5.0",
24
+ "computer-agents-openai": "0.5.0"
25
25
  },
26
26
  "keywords": [
27
27
  "computer-agents",