open-agents-ai 0.17.0 → 0.19.0

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.
Files changed (3) hide show
  1. package/README.md +229 -13
  2. package/dist/index.js +1279 -289
  3. package/package.json +4 -1
package/README.md CHANGED
@@ -29,13 +29,24 @@ An autonomous multi-turn tool-calling agent that reads your code, makes changes,
29
29
 
30
30
  ## Features
31
31
 
32
- - **26 autonomous tools** — file I/O, shell, grep, web search/fetch, memory, sub-agents, background tasks, image/OCR, git, diagnostics
32
+ - **35 autonomous tools** — file I/O, shell, grep, web search/fetch, memory, sub-agents, background tasks, image/OCR, git, diagnostics, vision, desktop automation, structured files, code sandbox
33
+ - **Moondream vision** — see and interact with the desktop via Moondream VLM (caption, query, detect, point-and-click)
34
+ - **Desktop automation** — vision-guided clicking: describe a UI element in natural language, the agent finds and clicks it
35
+ - **Auto-install desktop deps** — screenshot, mouse, OCR, and image tools auto-install missing system packages (scrot, xdotool, tesseract, imagemagick) on first use
33
36
  - **Parallel tool execution** — read-only tools run concurrently via `Promise.allSettled`
34
37
  - **Sub-agent delegation** — spawn independent agents for parallel workstreams
35
38
  - **Ralph Loop** — iterative task execution that keeps retrying until completion criteria are met
36
39
  - **Dream Mode** — creative idle exploration modeled after real sleep architecture (NREM→REM cycles)
37
40
  - **Live Listen** — bidirectional voice communication with real-time Whisper transcription
38
41
  - **Neural TTS** — hear what the agent is doing via GLaDOS or Overwatch ONNX voices
42
+ - **Cost tracking** — real-time token cost estimation for 15+ cloud providers
43
+ - **Work evaluation** — LLM-as-judge scoring with task-type-specific rubrics
44
+ - **Session metrics** — track turns, tool calls, tokens, files modified, tasks completed per session
45
+ - **Structured file generation** — create CSV, TSV, JSON, Markdown tables, and Excel-compatible files
46
+ - **Code sandbox** — isolated code execution in subprocess or Docker (JS, Python, Bash, TypeScript)
47
+ - **Structured file reading** — parse CSV, TSV, JSON, Markdown tables with binary format detection
48
+ - **Multi-provider web search** — DuckDuckGo (free), Tavily (structured), Jina AI (markdown) with auto-detection
49
+ - **Task templates** — specialized system prompts and tool recommendations for code, document, analysis, plan tasks
39
50
  - **Auto-expanding context** — detects RAM/VRAM and creates an optimized model variant on first run
40
51
  - **Mid-task steering** — type while the agent works to add context without interrupting
41
52
  - **Smart compaction** — long conversations compressed preserving files, commands, errors, decisions
@@ -139,6 +150,105 @@ The `transcribe-cli` dependency auto-installs in the background on first use.
139
150
 
140
151
  **File transcription**: Drag-and-drop audio/video files (`.mp3`, `.wav`, `.mp4`, `.mkv`, etc.) onto the terminal to transcribe them. Results are saved to `.oa/transcripts/`.
141
152
 
153
+ ## Vision & Desktop Automation (Moondream)
154
+
155
+ Open Agents can see your screen, understand UI elements, and interact with desktop applications through natural language — powered by the Moondream vision language model running entirely locally.
156
+
157
+ ### Desktop Awareness
158
+
159
+ The agent can take a screenshot and describe what's on screen:
160
+
161
+ ```
162
+ You: what's on my desktop right now?
163
+
164
+ Agent: [Turn 1] desktop_describe()
165
+ → "A Linux desktop showing three terminal windows with code editors,
166
+ a file manager in the background, and a taskbar at the bottom
167
+ with Firefox, Files, and Terminal icons."
168
+ ```
169
+
170
+ Ask specific questions about the screen:
171
+
172
+ ```
173
+ Agent: [Turn 1] desktop_describe(question="What application is in focus?")
174
+ → "The focused application is a terminal running vim with a Python file open."
175
+ ```
176
+
177
+ ### Vision Analysis
178
+
179
+ Analyze any image with four actions:
180
+
181
+ ```
182
+ Agent: vision(image="screenshot.png", action="caption")
183
+ → "A terminal window displaying code with syntax highlighting"
184
+
185
+ Agent: vision(image="ui.png", action="query", prompt="How many buttons are visible?")
186
+ → "There are 4 buttons visible: Save, Cancel, Help, and Close"
187
+
188
+ Agent: vision(image="ui.png", action="detect", prompt="button")
189
+ → Detected 4 "button" in ui.png:
190
+ 1. bbox: [0.10, 0.85, 0.25, 0.95]
191
+ 2. bbox: [0.30, 0.85, 0.45, 0.95]
192
+ ...
193
+
194
+ Agent: vision(image="ui.png", action="point", prompt="close button")
195
+ → Found 1 "close button" at (0.95, 0.02) — pixel (1824, 22)
196
+ ```
197
+
198
+ ### Point-and-Click
199
+
200
+ Describe what to click in plain English — the agent screenshots, finds the element with Moondream, and clicks it:
201
+
202
+ ```
203
+ Agent: desktop_click(target="the Save button")
204
+ → Clicked "Save button" at (480, 920)
205
+
206
+ Agent: desktop_click(target="File menu", button="left")
207
+ → Clicked "File menu" at (45, 12)
208
+
209
+ Agent: desktop_click(target="terminal icon", click_type="double")
210
+ → Clicked "terminal icon" at (1850, 540)
211
+ ```
212
+
213
+ Supports left/right/middle click, single/double click, multi-match selection by index, dry-run mode for verification, and configurable delay for UI transitions.
214
+
215
+ ### Setup
216
+
217
+ Moondream runs locally — no API keys, no cloud, your screen data never leaves your machine:
218
+
219
+ ```bash
220
+ # Create a Python venv and install Moondream Station
221
+ python3 -m venv .moondream-venv
222
+ .moondream-venv/bin/pip install moondream-station pydantic uvicorn fastapi packaging
223
+
224
+ # Start the vision server (downloads model on first run, ~1.7GB)
225
+ .moondream-venv/bin/python packages/execution/scripts/start-moondream.py
226
+ ```
227
+
228
+ The vision tools auto-detect a running Moondream Station on `localhost:2020`. For cloud inference, set `MOONDREAM_API_KEY` instead.
229
+
230
+ **System dependencies (auto-installed on first use):**
231
+
232
+ Desktop tools automatically install missing system packages when first needed. No manual setup required — just use the tool and it handles the rest:
233
+
234
+ | Tool | Linux Package | What It Does |
235
+ |------|--------------|-------------|
236
+ | `scrot` | `apt install scrot` | Screenshot capture |
237
+ | `xdotool` | `apt install xdotool` | Mouse/keyboard automation |
238
+ | `tesseract` | `apt install tesseract-ocr` | OCR text extraction |
239
+ | `identify` | `apt install imagemagick` | Image dimensions/conversion |
240
+
241
+ Supports `apt` (Debian/Ubuntu), `dnf` (Fedora), `pacman` (Arch), and `brew` (macOS). You can also pre-install everything at once:
242
+
243
+ ```bash
244
+ ./scripts/setup-desktop.sh # Install all desktop deps
245
+ ./scripts/setup-desktop.sh --check-only # Just check what's missing
246
+ ```
247
+
248
+ **Vision backend:**
249
+ - Moondream Station (local) — runs entirely on your machine, no API keys needed
250
+ - Moondream Cloud API — set `MOONDREAM_API_KEY` for cloud inference
251
+
142
252
  ## Interactive TUI
143
253
 
144
254
  Launch without arguments to enter the interactive REPL:
@@ -164,6 +274,10 @@ The TUI features an animated multilingual phrase carousel, live metrics bar with
164
274
  | `/tools` | List available tools |
165
275
  | `/skills` | List/search available skills |
166
276
  | `/update` | Check for and install updates (seamless reload) |
277
+ | `/cost` | Show token cost breakdown for the current session |
278
+ | `/evaluate` | Score the last completed task with LLM-as-judge |
279
+ | `/stats` | Show session metrics (turns, tools, tokens, files) |
280
+ | `/task-type <type>` | Set task type for specialized prompts (code, document, analysis, plan) |
167
281
  | `/config` | Show current configuration |
168
282
  | `/clear` | Clear the screen |
169
283
  | `/exit` | Quit |
@@ -181,33 +295,53 @@ While the agent is working (shown by the `+` prompt), type to add context:
181
295
  ⎿ Edit: src/auth.ts
182
296
  ```
183
297
 
184
- ## Tools (26)
298
+ ## Tools (35)
185
299
 
186
300
  | Tool | Description |
187
301
  |------|-------------|
302
+ | **File Operations** | |
188
303
  | `file_read` | Read file contents with line numbers (offset/limit) |
189
304
  | `file_write` | Create or overwrite files |
190
305
  | `file_edit` | Precise string replacement in files |
191
- | `shell` | Execute any shell command |
306
+ | `batch_edit` | Multiple edits across files in one call |
307
+ | `list_directory` | List directory contents |
308
+ | **Search & Navigation** | |
192
309
  | `grep_search` | Search file contents with regex (ripgrep) |
193
310
  | `find_files` | Find files by glob pattern |
194
- | `list_directory` | List directory contents |
195
- | `web_search` | Search the web via DuckDuckGo |
196
- | `web_fetch` | Fetch and extract text from web pages |
197
- | `memory_read` | Read from persistent memory store |
198
- | `memory_write` | Store patterns for future sessions |
199
- | `batch_edit` | Multiple edits across files in one call |
200
311
  | `codebase_map` | High-level project structure overview |
201
- | `diagnostic` | Lint/typecheck/test/build validation pipeline |
202
- | `git_info` | Structured git status, log, diff, branch info |
312
+ | **Shell & Execution** | |
313
+ | `shell` | Execute any shell command |
314
+ | `code_sandbox` | Isolated code execution (JS, Python, Bash, TS) in subprocess or Docker |
203
315
  | `background_run` | Run shell command in background |
204
316
  | `task_status` | Check background task status |
205
317
  | `task_output` | Read background task output |
206
318
  | `task_stop` | Stop a background task |
207
- | `sub_agent` | Delegate to an independent agent |
319
+ | **Web** | |
320
+ | `web_search` | Search the web (DuckDuckGo, Tavily, Jina AI — auto-detected) |
321
+ | `web_fetch` | Fetch and extract text from web pages |
322
+ | **Structured Data** | |
323
+ | `structured_file` | Generate CSV, TSV, JSON, Markdown tables, Excel-compatible files |
324
+ | `read_structured_file` | Parse CSV, TSV, JSON, Markdown tables with binary detection |
325
+ | **Vision & Desktop** | |
326
+ | `vision` | Moondream VLM — caption, query, detect, point on any image |
327
+ | `desktop_click` | Vision-guided clicking: describe a UI element, agent finds and clicks it |
328
+ | `desktop_describe` | Screenshot + Moondream caption/query for desktop awareness |
208
329
  | `image_read` | Read images (base64 + OCR) |
209
330
  | `screenshot` | Capture screen/window |
210
- | `ocr` | Extract text from images |
331
+ | `ocr` | Extract text from images (Tesseract) |
332
+ | **Memory & Knowledge** | |
333
+ | `memory_read` | Read from persistent memory store |
334
+ | `memory_write` | Store patterns for future sessions |
335
+ | **Git & Diagnostics** | |
336
+ | `diagnostic` | Lint/typecheck/test/build validation pipeline |
337
+ | `git_info` | Structured git status, log, diff, branch info |
338
+ | **Agents & Skills** | |
339
+ | `sub_agent` | Delegate to an independent agent |
340
+ | `create_tool` | Create reusable custom tools at runtime |
341
+ | `manage_tools` | List, inspect, delete custom tools |
342
+ | `skill_list` | Discover available AIWG skills |
343
+ | `skill_execute` | Run an AIWG skill |
344
+ | **AIWG SDLC** | |
211
345
  | `aiwg_setup` | Deploy AIWG SDLC framework |
212
346
  | `aiwg_health` | Analyze SDLC health |
213
347
  | `aiwg_workflow` | Execute AIWG workflows |
@@ -237,6 +371,88 @@ On startup and `/model` switch, Open Agents detects your RAM/VRAM and creates an
237
371
 
238
372
  Auto-downloads the ONNX voice model (~50MB) on first use. Install `espeak-ng` for best quality (`apt install espeak-ng` / `brew install espeak-ng`).
239
373
 
374
+ ## Cost Tracking & Session Metrics
375
+
376
+ Real-time token cost estimation for cloud providers. The status bar shows running cost when using a paid endpoint.
377
+
378
+ ```
379
+ /cost # Show cost breakdown by model/provider
380
+ /stats # Session metrics: turns, tool calls, tokens, files modified
381
+ /evaluate # Score the last completed task (LLM-as-judge, 5 rubric dimensions)
382
+ ```
383
+
384
+ Cost tracking supports 15+ providers including Groq, Together AI, OpenRouter, Fireworks AI, DeepInfra, Mistral, Cerebras, and more. Pricing is per-million tokens with separate input/output rates.
385
+
386
+ Work evaluation uses five task-type-specific rubrics (code, document, analysis, plan, general) scoring correctness, completeness, efficiency, code quality, and communication on a 1-5 scale.
387
+
388
+ ## Code Sandbox
389
+
390
+ Execute code snippets in isolated environments without affecting your project:
391
+
392
+ ```
393
+ Agent: code_sandbox(language="python", code="import math; print(math.factorial(20))")
394
+ → 2432902008176640000
395
+
396
+ Agent: code_sandbox(language="javascript", code="console.log([...new Set([1,2,2,3])].length)")
397
+ → 3
398
+ ```
399
+
400
+ Supports JavaScript, TypeScript, Python, and Bash. Two execution modes:
401
+ - **Subprocess** (default) — runs in a child process with timeout and output limits
402
+ - **Docker** — runs in an isolated container when `docker` is available
403
+
404
+ ## Structured Data Tools
405
+
406
+ ### Generate structured files
407
+
408
+ Create CSV, TSV, JSON, Markdown tables, and Excel-compatible files from data:
409
+
410
+ ```
411
+ Agent: structured_file(format="csv", path="results.csv", columns=["name","score"],
412
+ data=[{"name":"Alice","score":95},{"name":"Bob","score":87}])
413
+ → Created results.csv (2 rows, 2 columns)
414
+ ```
415
+
416
+ ### Read structured files
417
+
418
+ Parse existing data files with automatic format detection:
419
+
420
+ ```
421
+ Agent: read_structured_file(path="data.csv")
422
+ → CSV: 150 rows, 5 columns [showing first 100]
423
+
424
+ Agent: read_structured_file(path="report.md")
425
+ → Markdown: 3 table(s) extracted
426
+ ```
427
+
428
+ Detects binary formats (XLSX, PDF, DOCX) and suggests conversion tools.
429
+
430
+ ## Multi-Provider Web Search
431
+
432
+ Web search automatically selects the best available provider:
433
+
434
+ | Provider | Trigger | Features |
435
+ |----------|---------|----------|
436
+ | **DuckDuckGo** | Default (no key needed) | Free, privacy-focused |
437
+ | **Tavily** | `TAVILY_API_KEY` set | Structured results + AI-generated answer |
438
+ | **Jina AI** | `JINA_API_KEY` set | Markdown-formatted results |
439
+
440
+ ```bash
441
+ export TAVILY_API_KEY=tvly-... # Enable Tavily (optional)
442
+ export JINA_API_KEY=jina_... # Enable Jina AI (optional)
443
+ ```
444
+
445
+ ## Task Templates
446
+
447
+ Set a task type to get specialized system prompts, recommended tools, and output guidance:
448
+
449
+ ```
450
+ /task-type code # Code generation/fix — emphasizes tests, diffs, file edits
451
+ /task-type document # Documentation — emphasizes clarity, structure, completeness
452
+ /task-type analysis # Analysis tasks — emphasizes data, metrics, evidence
453
+ /task-type plan # Planning — emphasizes steps, dependencies, risks
454
+ ```
455
+
240
456
  ## Configuration
241
457
 
242
458
  Config priority: CLI flags > env vars > `~/.open-agents/config.json` > defaults.