computer-agents 0.4.7 → 0.4.8
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 +500 -57
- package/dist/metadata.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,9 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Computer Agents SDK
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/computer-agents)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
**The first orchestration framework for parallel computer-use agents.**
|
|
7
|
+
|
|
8
|
+
Scale from 1 to 100+ agents. Run experiments in parallel. Test multiple approaches simultaneously. computer-agents enables agent workflows that were previously impossible.
|
|
9
|
+
|
|
10
|
+
## What Makes This Different
|
|
11
|
+
|
|
12
|
+
Traditional agent frameworks focus on chat-based LLM agents. computer-agents is built for **computer-use agents** that write code, run tests, and modify files—with native support for **parallel execution at scale**.
|
|
13
|
+
|
|
14
|
+
### Before computer-agents
|
|
15
|
+
|
|
16
|
+
- ❌ No parallel orchestration for computer-use agents
|
|
17
|
+
- ❌ Single agent, single workspace, sequential execution
|
|
18
|
+
- ❌ Hours to run experiments sequentially
|
|
19
|
+
- ❌ Limited to local machine resources
|
|
20
|
+
|
|
21
|
+
### With computer-agents
|
|
22
|
+
|
|
23
|
+
- ✅ **Parallel Orchestration** - Run 10, 50, 100+ agents simultaneously
|
|
24
|
+
- ✅ **Unified Interface** - Seamless local ↔ cloud execution with one config change
|
|
25
|
+
- ✅ **Workspace Collaboration** - Multiple agents working on the same codebase
|
|
26
|
+
- ✅ **Cloud Scalability** - Effortless scaling beyond local machine limits
|
|
27
|
+
- ✅ **Session Continuity** - Automatic multi-turn conversations
|
|
28
|
+
|
|
29
|
+
## Revolutionary Use Cases
|
|
30
|
+
|
|
31
|
+
**🔬 Scientific Experiments**
|
|
32
|
+
Run 20 experimental variations in parallel instead of sequentially. What took hours now takes minutes.
|
|
33
|
+
|
|
34
|
+
**🧪 ML/AI Development**
|
|
35
|
+
Test dozens of hyperparameter configurations simultaneously. Systematic exploration of model architectures at scale.
|
|
36
|
+
|
|
37
|
+
**⚡️ Multi-Approach Problem Solving**
|
|
38
|
+
Try 5 different implementation approaches in parallel. Let the agents find the best solution.
|
|
39
|
+
|
|
40
|
+
**🚀 A/B Testing at Scale**
|
|
41
|
+
Test multiple implementations, frameworks, or approaches concurrently. Data-driven decision making.
|
|
7
42
|
|
|
8
43
|
## Installation
|
|
9
44
|
|
|
@@ -13,76 +48,216 @@ npm install computer-agents
|
|
|
13
48
|
|
|
14
49
|
## Quick Start
|
|
15
50
|
|
|
51
|
+
### Local Computer Agent
|
|
52
|
+
|
|
16
53
|
```typescript
|
|
17
54
|
import { Agent, run, LocalRuntime } from 'computer-agents';
|
|
18
55
|
|
|
19
56
|
const agent = new Agent({
|
|
20
|
-
agentType:
|
|
57
|
+
agentType: "computer",
|
|
21
58
|
runtime: new LocalRuntime(),
|
|
22
|
-
|
|
59
|
+
workspace: "./my-project",
|
|
60
|
+
instructions: "You are an expert developer."
|
|
23
61
|
});
|
|
24
62
|
|
|
25
|
-
const result = await run(agent, "Create a Python script that
|
|
63
|
+
const result = await run(agent, "Create a Python script that calculates fibonacci numbers");
|
|
26
64
|
console.log(result.finalOutput);
|
|
27
65
|
```
|
|
28
66
|
|
|
29
|
-
|
|
67
|
+
### Cloud Computer Agent (with workspace sync)
|
|
30
68
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **⚡️ Automatic Session Continuity** - Multi-turn conversations work automatically
|
|
34
|
-
- **🔌 Unified MCP Config** - Single configuration for all agent types
|
|
35
|
-
- **📦 Manual Composition** - Build custom workflows explicitly
|
|
36
|
-
- **☁️ Cloud Execution** - GCE-based with workspace sync
|
|
37
|
-
- **✨ Professional** - Zero type assertions, clean abstractions
|
|
69
|
+
```typescript
|
|
70
|
+
import { Agent, run, CloudRuntime } from 'computer-agents';
|
|
38
71
|
|
|
39
|
-
|
|
72
|
+
const agent = new Agent({
|
|
73
|
+
agentType: "computer",
|
|
74
|
+
runtime: new CloudRuntime({ apiKey: process.env.TESTBASE_API_KEY }),
|
|
75
|
+
workspace: "./my-project",
|
|
76
|
+
instructions: "You are an expert developer."
|
|
77
|
+
});
|
|
40
78
|
|
|
41
|
-
|
|
79
|
+
const result = await run(agent, "Add unit tests to the fibonacci module");
|
|
80
|
+
console.log(result.finalOutput);
|
|
81
|
+
// Files automatically synced from cloud to local workspace
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Cloud-Only Mode (no local sync)
|
|
85
|
+
|
|
86
|
+
Perfect for CI/CD, experiments, and parallel tasks:
|
|
42
87
|
|
|
43
88
|
```typescript
|
|
44
|
-
|
|
89
|
+
const runtime = new CloudRuntime({
|
|
90
|
+
apiKey: process.env.TESTBASE_API_KEY,
|
|
91
|
+
skipWorkspaceSync: true, // No upload/download, faster execution
|
|
92
|
+
});
|
|
45
93
|
|
|
46
94
|
const agent = new Agent({
|
|
47
|
-
agentType:
|
|
48
|
-
runtime
|
|
49
|
-
workspace:
|
|
50
|
-
instructions: 'You are an expert developer.'
|
|
95
|
+
agentType: "computer",
|
|
96
|
+
runtime,
|
|
97
|
+
workspace: "./cloud-workspace", // Placeholder, not synced
|
|
51
98
|
});
|
|
52
99
|
|
|
53
|
-
const result = await run(agent,
|
|
100
|
+
const result = await run(agent, "Build a REST API with Express");
|
|
101
|
+
// Executes in fresh cloud workspace, results stay in cloud
|
|
54
102
|
```
|
|
55
103
|
|
|
56
|
-
###
|
|
104
|
+
### Parallel Execution (The Game Changer)
|
|
105
|
+
|
|
106
|
+
Run multiple agents simultaneously:
|
|
57
107
|
|
|
58
108
|
```typescript
|
|
59
109
|
import { Agent, run, CloudRuntime } from 'computer-agents';
|
|
60
110
|
|
|
61
|
-
const
|
|
111
|
+
const runtime = new CloudRuntime({
|
|
112
|
+
apiKey: process.env.TESTBASE_API_KEY,
|
|
113
|
+
skipWorkspaceSync: true,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Create 5 agents to test different approaches
|
|
117
|
+
const agents = [
|
|
118
|
+
'Express',
|
|
119
|
+
'Fastify',
|
|
120
|
+
'Koa',
|
|
121
|
+
'Hapi',
|
|
122
|
+
'Restify'
|
|
123
|
+
].map(framework => new Agent({
|
|
124
|
+
name: `${framework} Agent`,
|
|
62
125
|
agentType: 'computer',
|
|
63
|
-
runtime
|
|
64
|
-
workspace:
|
|
126
|
+
runtime,
|
|
127
|
+
workspace: `./test-${framework.toLowerCase()}`,
|
|
128
|
+
instructions: `You are an expert in ${framework}.`
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
// Run all 5 in parallel!
|
|
132
|
+
const results = await Promise.all(
|
|
133
|
+
agents.map((agent, i) => run(agent, `Create a REST API with ${frameworks[i]}`))
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
// All 5 implementations complete in the time it takes to run 1
|
|
137
|
+
console.log('All 5 frameworks tested in parallel!');
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### LLM Agent (for planning and reasoning)
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
const planner = new Agent({
|
|
144
|
+
agentType: "llm",
|
|
145
|
+
model: "gpt-4o",
|
|
146
|
+
instructions: "You create detailed implementation plans."
|
|
65
147
|
});
|
|
66
148
|
|
|
67
|
-
const
|
|
149
|
+
const plan = await run(planner, "Plan how to add user authentication");
|
|
150
|
+
console.log(plan.finalOutput);
|
|
68
151
|
```
|
|
69
152
|
|
|
70
|
-
|
|
153
|
+
## Core Concepts
|
|
154
|
+
|
|
155
|
+
### Agent Types
|
|
71
156
|
|
|
72
157
|
```typescript
|
|
73
|
-
|
|
158
|
+
type AgentType = 'llm' | 'computer';
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
| Type | Execution | Use Cases |
|
|
162
|
+
|------|-----------|-----------|
|
|
163
|
+
| `'llm'` | OpenAI API | Planning, reasoning, reviewing |
|
|
164
|
+
| `'computer'` | Codex SDK | Code, tests, file operations, terminal commands |
|
|
165
|
+
|
|
166
|
+
### Runtime Abstraction
|
|
167
|
+
|
|
168
|
+
Switch between local and cloud execution with one config change:
|
|
74
169
|
|
|
170
|
+
```typescript
|
|
171
|
+
// Local execution
|
|
172
|
+
const localRuntime = new LocalRuntime();
|
|
173
|
+
|
|
174
|
+
// Cloud execution
|
|
175
|
+
const cloudRuntime = new CloudRuntime({
|
|
176
|
+
apiKey: process.env.TESTBASE_API_KEY
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Use either runtime with any agent
|
|
75
180
|
const agent = new Agent({
|
|
76
|
-
agentType: '
|
|
77
|
-
|
|
78
|
-
|
|
181
|
+
agentType: 'computer',
|
|
182
|
+
runtime: localRuntime, // or cloudRuntime
|
|
183
|
+
workspace: './project'
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Workspace Modes
|
|
188
|
+
|
|
189
|
+
**Default Mode** - Sync local ↔ cloud:
|
|
190
|
+
```typescript
|
|
191
|
+
const runtime = new CloudRuntime({
|
|
192
|
+
apiKey: process.env.TESTBASE_API_KEY,
|
|
193
|
+
// skipWorkspaceSync: false (default)
|
|
194
|
+
});
|
|
195
|
+
// Uploads local files, downloads results
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Cloud-Only Mode** - No local sync:
|
|
199
|
+
```typescript
|
|
200
|
+
const runtime = new CloudRuntime({
|
|
201
|
+
apiKey: process.env.TESTBASE_API_KEY,
|
|
202
|
+
skipWorkspaceSync: true, // NEW in v0.4.6
|
|
79
203
|
});
|
|
204
|
+
// Fresh cloud workspace, no upload/download
|
|
205
|
+
// Perfect for CI/CD, experiments, parallel tasks
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Session Continuity
|
|
209
|
+
|
|
210
|
+
Agents automatically maintain context across multiple runs:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
const agent = new Agent({
|
|
214
|
+
agentType: 'computer',
|
|
215
|
+
runtime: new LocalRuntime(),
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
await run(agent, 'Create app.py'); // New session
|
|
219
|
+
await run(agent, 'Add error handling'); // Continues same session!
|
|
220
|
+
await run(agent, 'Add tests'); // Still same session!
|
|
221
|
+
|
|
222
|
+
console.log(agent.currentThreadId); // Thread ID maintained
|
|
223
|
+
|
|
224
|
+
agent.resetSession(); // Start fresh when needed
|
|
225
|
+
await run(agent, 'New project'); // New session
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Examples
|
|
229
|
+
|
|
230
|
+
Comprehensive examples demonstrating the power of computer-agents:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Clone the repository
|
|
234
|
+
git clone https://github.com/TestBase-ai/computer-agents.git
|
|
235
|
+
cd computer-agents
|
|
236
|
+
npm install
|
|
237
|
+
npm run build
|
|
238
|
+
|
|
239
|
+
# Workspace sync modes (default vs cloud-only)
|
|
240
|
+
node examples/testbase/workspace-sync-modes.mjs
|
|
241
|
+
|
|
242
|
+
# Parallel execution (the game changer!)
|
|
243
|
+
node examples/testbase/parallel-execution.mjs
|
|
80
244
|
|
|
81
|
-
|
|
245
|
+
# Scale experiments (ML hyperparameter tuning, algorithm comparison)
|
|
246
|
+
node examples/testbase/scale-experiments.mjs
|
|
247
|
+
|
|
248
|
+
# Multi-agent workflows (planner → executor → reviewer)
|
|
249
|
+
node examples/testbase/multi-agent-workflow.mjs
|
|
250
|
+
|
|
251
|
+
# Session continuity demonstration
|
|
252
|
+
node examples/testbase/hello-world.mjs
|
|
82
253
|
```
|
|
83
254
|
|
|
255
|
+
**[📂 View all examples →](https://github.com/TestBase-ai/computer-agents/tree/main/examples/testbase)**
|
|
256
|
+
|
|
84
257
|
## Multi-Agent Workflows
|
|
85
258
|
|
|
259
|
+
Build custom workflows by composing agents:
|
|
260
|
+
|
|
86
261
|
```typescript
|
|
87
262
|
import { Agent, run, LocalRuntime } from 'computer-agents';
|
|
88
263
|
|
|
@@ -107,41 +282,66 @@ const reviewer = new Agent({
|
|
|
107
282
|
instructions: 'Review implementations for quality.'
|
|
108
283
|
});
|
|
109
284
|
|
|
110
|
-
// Manual workflow
|
|
285
|
+
// Manual workflow composition - you control the flow
|
|
111
286
|
const task = "Add user authentication";
|
|
112
287
|
const plan = await run(planner, `Plan: ${task}`);
|
|
113
288
|
const code = await run(executor, plan.finalOutput);
|
|
114
289
|
const review = await run(reviewer, `Review: ${code.finalOutput}`);
|
|
115
290
|
```
|
|
116
291
|
|
|
117
|
-
##
|
|
292
|
+
## Configuration
|
|
118
293
|
|
|
119
|
-
|
|
294
|
+
### Environment Variables
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# Required for LLM agents and computer agents (Codex SDK uses OpenAI)
|
|
298
|
+
OPENAI_API_KEY=your-openai-key
|
|
299
|
+
|
|
300
|
+
# Optional for CloudRuntime (has default)
|
|
301
|
+
TESTBASE_API_KEY=your-testbase-key # Get from testbase.ai
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Runtime Configuration
|
|
120
305
|
|
|
121
306
|
```typescript
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
307
|
+
// LocalRuntime
|
|
308
|
+
const localRuntime = new LocalRuntime({
|
|
309
|
+
debug: true, // Show detailed logs
|
|
310
|
+
skipGitRepoCheck: true, // Allow execution outside git repos (default: true)
|
|
125
311
|
});
|
|
126
312
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
313
|
+
// CloudRuntime
|
|
314
|
+
const cloudRuntime = new CloudRuntime({
|
|
315
|
+
apiKey: process.env.TESTBASE_API_KEY, // Required (or use env var)
|
|
316
|
+
debug: true, // Show detailed logs
|
|
317
|
+
skipWorkspaceSync: false, // Sync local ↔ cloud (default: false)
|
|
318
|
+
timeout: 600000, // 10 minutes (default)
|
|
319
|
+
});
|
|
133
320
|
```
|
|
134
321
|
|
|
135
|
-
|
|
322
|
+
### Agent Configuration
|
|
136
323
|
|
|
137
|
-
|
|
324
|
+
```typescript
|
|
325
|
+
const agent = new Agent({
|
|
326
|
+
name: "My Agent", // Optional, auto-generated if omitted
|
|
327
|
+
agentType: 'computer', // 'llm' | 'computer'
|
|
138
328
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
329
|
+
// Computer agent specific
|
|
330
|
+
runtime: new LocalRuntime(), // Required for computer agents
|
|
331
|
+
workspace: './my-project', // Required for computer agents
|
|
332
|
+
|
|
333
|
+
// LLM agent specific
|
|
334
|
+
model: 'gpt-4o', // Required for LLM agents
|
|
335
|
+
|
|
336
|
+
// Shared
|
|
337
|
+
instructions: "You are helpful.", // System prompt
|
|
338
|
+
mcpServers: [...], // MCP server configurations (optional)
|
|
339
|
+
});
|
|
142
340
|
```
|
|
143
341
|
|
|
144
|
-
|
|
342
|
+
## MCP Server Integration
|
|
343
|
+
|
|
344
|
+
Unified MCP configuration works for both agent types:
|
|
145
345
|
|
|
146
346
|
```typescript
|
|
147
347
|
import type { McpServerConfig } from 'computer-agents';
|
|
@@ -161,24 +361,267 @@ const mcpServers: McpServerConfig[] = [
|
|
|
161
361
|
}
|
|
162
362
|
];
|
|
163
363
|
|
|
364
|
+
// Works for both LLM and computer agents!
|
|
164
365
|
const agent = new Agent({
|
|
165
366
|
agentType: 'computer',
|
|
166
367
|
runtime: new LocalRuntime(),
|
|
167
|
-
mcpServers //
|
|
368
|
+
mcpServers // Automatically converted to appropriate format
|
|
168
369
|
});
|
|
169
370
|
```
|
|
170
371
|
|
|
372
|
+
The SDK handles conversion automatically:
|
|
373
|
+
- **LLM agents**: MCP servers → function tools
|
|
374
|
+
- **Computer agents**: MCP servers → Codex SDK config
|
|
375
|
+
|
|
376
|
+
## Performance
|
|
377
|
+
|
|
378
|
+
### LocalRuntime
|
|
379
|
+
- **Cold start**: <1 second
|
|
380
|
+
- **Warm execution**: <100ms overhead
|
|
381
|
+
- **Parallelization**: Limited by local CPU/memory
|
|
382
|
+
|
|
383
|
+
### CloudRuntime (Default Mode)
|
|
384
|
+
- **First execution**: 30-45 seconds (includes workspace sync)
|
|
385
|
+
- **Subsequent runs**: ~5-10 seconds
|
|
386
|
+
- **Parallelization**: Scale to 100+ agents
|
|
387
|
+
|
|
388
|
+
### CloudRuntime (Cloud-Only Mode)
|
|
389
|
+
- **Execution**: Faster (no sync overhead)
|
|
390
|
+
- **Parallelization**: Scale to 100+ agents
|
|
391
|
+
- **Perfect for**: CI/CD, experiments, parallel tasks
|
|
392
|
+
|
|
393
|
+
## API Reference
|
|
394
|
+
|
|
395
|
+
### Agent
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
class Agent {
|
|
399
|
+
constructor(config: AgentConfiguration);
|
|
400
|
+
|
|
401
|
+
currentThreadId: string | undefined; // Current session thread ID
|
|
402
|
+
resetSession(): void; // Start new session
|
|
403
|
+
workspace: string; // Workspace path
|
|
404
|
+
agentType: 'llm' | 'computer'; // Agent type
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### run()
|
|
409
|
+
|
|
410
|
+
```typescript
|
|
411
|
+
function run(
|
|
412
|
+
agent: Agent,
|
|
413
|
+
task: string,
|
|
414
|
+
options?: RunOptions
|
|
415
|
+
): Promise<RunResult>;
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### LocalRuntime
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
class LocalRuntime implements Runtime {
|
|
422
|
+
constructor(config?: {
|
|
423
|
+
debug?: boolean;
|
|
424
|
+
skipGitRepoCheck?: boolean; // default: true
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
readonly type: 'local';
|
|
428
|
+
execute(config: RuntimeExecutionConfig): Promise<RuntimeExecutionResult>;
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### CloudRuntime
|
|
433
|
+
|
|
434
|
+
```typescript
|
|
435
|
+
class CloudRuntime implements Runtime {
|
|
436
|
+
constructor(config?: {
|
|
437
|
+
apiKey?: string; // Required (or env var TESTBASE_API_KEY)
|
|
438
|
+
debug?: boolean;
|
|
439
|
+
skipWorkspaceSync?: boolean; // default: false
|
|
440
|
+
timeout?: number; // default: 600000ms (10 min)
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
readonly type: 'cloud';
|
|
444
|
+
execute(config: RuntimeExecutionConfig): Promise<RuntimeExecutionResult>;
|
|
445
|
+
cleanup(): Promise<void>;
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
## Architecture
|
|
450
|
+
|
|
451
|
+
```
|
|
452
|
+
computer-agents/
|
|
453
|
+
├── packages/
|
|
454
|
+
│ ├── agents-core/ # Core SDK
|
|
455
|
+
│ │ ├── src/
|
|
456
|
+
│ │ │ ├── agent.ts # Agent class
|
|
457
|
+
│ │ │ ├── run.ts # Run loop
|
|
458
|
+
│ │ │ ├── runtime/ # Runtime abstraction
|
|
459
|
+
│ │ │ │ ├── LocalRuntime.ts
|
|
460
|
+
│ │ │ │ ├── CloudRuntime.ts
|
|
461
|
+
│ │ │ │ └── gcsWorkspace.ts
|
|
462
|
+
│ │ │ ├── codex/ # Codex SDK integration
|
|
463
|
+
│ │ │ ├── cloud/ # Cloud API client
|
|
464
|
+
│ │ │ └── mcpConfig.ts # Unified MCP types
|
|
465
|
+
│ │ └── package.json
|
|
466
|
+
│ │
|
|
467
|
+
│ ├── agents/ # Main package export
|
|
468
|
+
│ ├── agents-openai/ # OpenAI provider
|
|
469
|
+
│ └── cloud-infrastructure/ # GCE cloud execution server
|
|
470
|
+
│
|
|
471
|
+
└── examples/testbase/ # Working examples
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## Best Practices
|
|
475
|
+
|
|
476
|
+
### Choosing Local vs Cloud
|
|
477
|
+
|
|
478
|
+
**Use LocalRuntime when:**
|
|
479
|
+
- Development and rapid iteration
|
|
480
|
+
- Working with local files/tools
|
|
481
|
+
- No cloud infrastructure needed
|
|
482
|
+
- Testing and debugging
|
|
483
|
+
|
|
484
|
+
**Use CloudRuntime when:**
|
|
485
|
+
- Parallel execution at scale
|
|
486
|
+
- Production deployments
|
|
487
|
+
- CI/CD pipelines
|
|
488
|
+
- Need isolated execution environments
|
|
489
|
+
- Experiments requiring multiple concurrent agents
|
|
490
|
+
|
|
491
|
+
### Choosing Workspace Sync Mode
|
|
492
|
+
|
|
493
|
+
**Use Default Mode (skipWorkspaceSync: false) when:**
|
|
494
|
+
- You need results in your local filesystem
|
|
495
|
+
- Continuing work locally after cloud execution
|
|
496
|
+
- Interactive development workflows
|
|
497
|
+
|
|
498
|
+
**Use Cloud-Only Mode (skipWorkspaceSync: true) when:**
|
|
499
|
+
- CI/CD pipelines (no local filesystem)
|
|
500
|
+
- Running experiments at scale
|
|
501
|
+
- Parallel task execution
|
|
502
|
+
- Faster execution (skip sync overhead)
|
|
503
|
+
|
|
504
|
+
### Session Management
|
|
505
|
+
|
|
506
|
+
Always use the **same agent instance** for session continuity:
|
|
507
|
+
|
|
508
|
+
```typescript
|
|
509
|
+
// ✅ Correct - same agent, continuous session
|
|
510
|
+
const agent = new Agent({...});
|
|
511
|
+
await run(agent, 'Task 1');
|
|
512
|
+
await run(agent, 'Task 2'); // Continues session
|
|
513
|
+
|
|
514
|
+
// ❌ Wrong - different agents, new sessions
|
|
515
|
+
await run(new Agent({...}), 'Task 1');
|
|
516
|
+
await run(new Agent({...}), 'Task 2'); // Different session!
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### Parallel Execution
|
|
520
|
+
|
|
521
|
+
Use `Promise.all()` for parallel execution:
|
|
522
|
+
|
|
523
|
+
```typescript
|
|
524
|
+
const agents = [agent1, agent2, agent3];
|
|
525
|
+
const tasks = ['Task 1', 'Task 2', 'Task 3'];
|
|
526
|
+
|
|
527
|
+
// ✅ Parallel - all execute simultaneously
|
|
528
|
+
const results = await Promise.all(
|
|
529
|
+
agents.map((agent, i) => run(agent, tasks[i]))
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
// ❌ Sequential - one at a time
|
|
533
|
+
for (let i = 0; i < agents.length; i++) {
|
|
534
|
+
await run(agents[i], tasks[i]); // Slower!
|
|
535
|
+
}
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
## Cloud Infrastructure
|
|
539
|
+
|
|
540
|
+
computer-agents includes production-ready cloud infrastructure:
|
|
541
|
+
|
|
542
|
+
- **GCS Bucket** - Workspace storage (`gs://testbase-workspaces`)
|
|
543
|
+
- **GCE VM** - Codex SDK execution server
|
|
544
|
+
- **Pay-per-token** - Credit-based billing system
|
|
545
|
+
- **API Keys** - Database-backed authentication
|
|
546
|
+
- **Budget Protection** - Daily/monthly spending limits
|
|
547
|
+
|
|
548
|
+
See [Cloud Infrastructure docs](./packages/cloud-infrastructure/README.md) for deployment details.
|
|
549
|
+
|
|
171
550
|
## Documentation
|
|
172
551
|
|
|
173
|
-
- [
|
|
174
|
-
- [
|
|
175
|
-
- [
|
|
552
|
+
- **[Examples](https://github.com/TestBase-ai/computer-agents/tree/main/examples/testbase)** - Comprehensive working examples
|
|
553
|
+
- **[Cloud Infrastructure](./packages/cloud-infrastructure/README.md)** - Deployment and configuration
|
|
554
|
+
- **[Architecture](../docs/ARCHITECTURE.md)** - System design and internals
|
|
555
|
+
|
|
556
|
+
## Troubleshooting
|
|
557
|
+
|
|
558
|
+
### "OPENAI_API_KEY not set"
|
|
559
|
+
```bash
|
|
560
|
+
export OPENAI_API_KEY=sk-...
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
### "TESTBASE_API_KEY required"
|
|
564
|
+
```bash
|
|
565
|
+
export TESTBASE_API_KEY=your-key
|
|
566
|
+
# Or provide in constructor:
|
|
567
|
+
new CloudRuntime({ apiKey: 'your-key' })
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Session continuity not working
|
|
571
|
+
Ensure you're using the **same agent instance** across runs.
|
|
572
|
+
|
|
573
|
+
### Cloud execution slow
|
|
574
|
+
Use `skipWorkspaceSync: true` to skip upload/download overhead:
|
|
575
|
+
```typescript
|
|
576
|
+
new CloudRuntime({ skipWorkspaceSync: true })
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
## What's New
|
|
580
|
+
|
|
581
|
+
### v0.4.6
|
|
582
|
+
- **Cloud-Only Mode**: `skipWorkspaceSync` option for CloudRuntime
|
|
583
|
+
- Perfect for CI/CD and parallel experiments
|
|
584
|
+
- Faster cloud execution (no sync overhead)
|
|
585
|
+
|
|
586
|
+
### v0.4.5
|
|
587
|
+
- Fixed maxBuffer overflow for large workspace syncs
|
|
588
|
+
- Improved GCS operation stability
|
|
589
|
+
|
|
590
|
+
### v0.4.0
|
|
591
|
+
- Initial public release
|
|
592
|
+
- Parallel computer-use agent orchestration
|
|
593
|
+
- Unified local/cloud runtime abstraction
|
|
594
|
+
- Session continuity
|
|
595
|
+
|
|
596
|
+
## Differences from OpenAI Agents SDK
|
|
597
|
+
|
|
598
|
+
computer-agents extends OpenAI's Agents SDK with:
|
|
599
|
+
|
|
600
|
+
1. **Computer-use agent type** - Direct Codex SDK integration
|
|
601
|
+
2. **Runtime abstraction** - Local and cloud execution modes
|
|
602
|
+
3. **Parallel orchestration** - Native support for concurrent agents
|
|
603
|
+
4. **Session continuity** - Automatic thread management
|
|
604
|
+
5. **Cloud infrastructure** - Production-ready execution platform
|
|
605
|
+
6. **Unified MCP config** - Single configuration for all agent types
|
|
176
606
|
|
|
177
607
|
## License
|
|
178
608
|
|
|
179
609
|
MIT
|
|
180
610
|
|
|
181
|
-
##
|
|
611
|
+
## Links
|
|
612
|
+
|
|
613
|
+
- **GitHub**: [https://github.com/TestBase-ai/computer-agents](https://github.com/TestBase-ai/computer-agents)
|
|
614
|
+
- **Examples**: [https://github.com/TestBase-ai/computer-agents/tree/main/examples/testbase](https://github.com/TestBase-ai/computer-agents/tree/main/examples/testbase)
|
|
615
|
+
- **npm**: [https://www.npmjs.com/package/computer-agents](https://www.npmjs.com/package/computer-agents)
|
|
616
|
+
- **Website**: [https://testbase.ai/computer-agents](https://testbase.ai/computer-agents)
|
|
617
|
+
|
|
618
|
+
## Support
|
|
619
|
+
|
|
620
|
+
- **Issues**: [GitHub Issues](https://github.com/TestBase-ai/computer-agents/issues)
|
|
621
|
+
- **Website**: [testbase.ai](https://testbase.ai)
|
|
622
|
+
|
|
623
|
+
---
|
|
624
|
+
|
|
625
|
+
**Built with ❤️ by [TestBase](https://testbase.ai)**
|
|
182
626
|
|
|
183
|
-
|
|
184
|
-
- Integrates with [@openai/codex-sdk](https://www.npmjs.com/package/@openai/codex-sdk)
|
|
627
|
+
*Based on [OpenAI Agents SDK](https://github.com/openai/openai-agents-sdk) • Powered by [Codex SDK](https://github.com/anthropics/claude-code) • Cloud infrastructure on GCP*
|
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.
|
|
7
|
+
"version": "0.4.8",
|
|
8
8
|
"versions": {
|
|
9
|
-
"computer-agents": "0.4.
|
|
9
|
+
"computer-agents": "0.4.8"
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
exports.default = exports.METADATA;
|
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.
|
|
5
|
+
"version": "0.4.8",
|
|
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.
|
|
24
|
-
"computer-agents-openai": "0.4.
|
|
23
|
+
"computer-agents-core": "0.4.8",
|
|
24
|
+
"computer-agents-openai": "0.4.8"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
27
27
|
"computer-agents",
|