computer-agents 0.4.9 → 0.4.11

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
@@ -101,6 +101,67 @@ const result = await run(agent, "Build a REST API with Express");
101
101
  // Executes in fresh cloud workspace, results stay in cloud
102
102
  ```
103
103
 
104
+ ### Streaming Progress (Real-Time Visibility)
105
+
106
+ Track agent execution in real-time with `runStreamed()`:
107
+
108
+ ```typescript
109
+ import { Agent, runStreamed, LocalRuntime } from 'computer-agents';
110
+
111
+ const agent = new Agent({
112
+ agentType: "computer",
113
+ runtime: new LocalRuntime(),
114
+ workspace: "./my-project",
115
+ });
116
+
117
+ // Stream events in real-time
118
+ for await (const event of runStreamed(agent, 'Create a Python web scraper')) {
119
+ switch (event.type) {
120
+ case 'thread.started':
121
+ console.log(`🔗 Thread: ${event.thread_id}`);
122
+ break;
123
+ case 'turn.started':
124
+ console.log('🎬 Turn started');
125
+ break;
126
+ case 'item.completed':
127
+ if (event.item.type === 'file_change') {
128
+ const files = event.item.changes.map(c => `${c.kind} ${c.path}`).join(', ');
129
+ console.log(`✅ Files: ${files}`);
130
+ }
131
+ break;
132
+ case 'turn.completed':
133
+ console.log(`🎉 Completed (${event.usage.input_tokens + event.usage.output_tokens} tokens)`);
134
+ break;
135
+ }
136
+ }
137
+ ```
138
+
139
+ **Event Types:**
140
+ - `thread.started` - Session initialized with thread ID
141
+ - `turn.started` - Agent begins processing
142
+ - `item.started` - Tool call or action begins
143
+ - `item.completed` - Tool call or action completes (includes file changes)
144
+ - `turn.completed` - Processing finished (includes token usage)
145
+ - `turn.failed` - Error occurred
146
+
147
+ **Use Cases:**
148
+ - Progress bars for long-running tasks
149
+ - Real-time logging and debugging
150
+ - Live UI updates in applications
151
+ - Better UX for multi-step operations
152
+
153
+ **API Consistency:** `runStreamed()` mirrors `run()` - same signature, just with streaming!
154
+
155
+ ```typescript
156
+ // Standard execution
157
+ const result = await run(agent, task);
158
+
159
+ // Streaming execution
160
+ for await (const event of runStreamed(agent, task)) {
161
+ // Real-time progress
162
+ }
163
+ ```
164
+
104
165
  ### Parallel Execution (The Game Changer)
105
166
 
106
167
  Run multiple agents simultaneously:
@@ -236,6 +297,9 @@ cd computer-agents
236
297
  npm install
237
298
  npm run build
238
299
 
300
+ # Streaming progress (real-time event visibility)
301
+ node examples/testbase/streaming-progress.cjs
302
+
239
303
  # Workspace sync modes (default vs cloud-only)
240
304
  node examples/testbase/workspace-sync-modes.mjs
241
305
 
@@ -415,6 +479,30 @@ function run(
415
479
  ): Promise<RunResult>;
416
480
  ```
417
481
 
482
+ ### runStreamed()
483
+
484
+ ```typescript
485
+ function runStreamed(
486
+ agent: Agent,
487
+ task: string,
488
+ options?: RunOptions
489
+ ): AsyncGenerator<Event>;
490
+ ```
491
+
492
+ Stream real-time events during agent execution. Returns an async generator that yields:
493
+ - `thread.started` - Session initialized
494
+ - `turn.started` - Agent begins processing
495
+ - `item.started` / `item.completed` - Tool calls and file changes
496
+ - `turn.completed` - Processing finished with usage stats
497
+ - `turn.failed` - Error occurred
498
+
499
+ **Example:**
500
+ ```typescript
501
+ for await (const event of runStreamed(agent, 'Create app.py')) {
502
+ console.log(event.type, event);
503
+ }
504
+ ```
505
+
418
506
  ### LocalRuntime
419
507
 
420
508
  ```typescript
@@ -578,6 +666,12 @@ new CloudRuntime({ skipWorkspaceSync: true })
578
666
 
579
667
  ## What's New
580
668
 
669
+ ### v0.4.9
670
+ - **Streaming Progress**: New `runStreamed()` function for real-time visibility
671
+ - Stream events: thread.started, turn.started, item.completed, turn.completed
672
+ - API consistency - mirrors `run()` signature for easy adoption
673
+ - Perfect for progress bars, real-time logging, and better UX
674
+
581
675
  ### v0.4.6
582
676
  - **Cloud-Only Mode**: `skipWorkspaceSync` option for CloudRuntime
583
677
  - Perfect for CI/CD and parallel experiments
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.9",
7
+ "version": "0.4.11",
8
8
  "versions": {
9
- "computer-agents": "0.4.9"
9
+ "computer-agents": "0.4.11"
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,OAAO;IAClB,UAAU,EAAE;QACV,iBAAiB,EAAE,OAAO;KAC3B;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,QAAQ;IACnB,UAAU,EAAE;QACV,iBAAiB,EAAE,QAAQ;KAC5B;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.9",
5
+ "version": "0.4.11",
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": "workspace:*",
24
- "computer-agents-openai": "workspace:*"
23
+ "computer-agents-core": "0.4.11",
24
+ "computer-agents-openai": "0.4.11"
25
25
  },
26
26
  "keywords": [
27
27
  "computer-agents",