The Vercel AI SDK (Documentation Index
Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
Use this file to discover all available pages before exploring further.
ai) drives tool-calling agents around any provider in its registry. Mirage ships a tool factory that exposes a Workspace as five typed tools (execute, readFile, writeFile, editFile, ls) for generateText / streamText / agent loops.
Install
@struktoai/mirage-agents/vercel is runtime-agnostic. Pair it with @struktoai/mirage-node for Node or @struktoai/mirage-browser for the browser.
Usage
Exports
| Symbol | Purpose |
|---|---|
mirageTools(ws) | Returns { execute, readFile, writeFile, editFile, ls }, each a tool() from ai ready to spread into tools: { ... }. |
Tool reference
| Tool | Input | Output |
|---|---|---|
execute | { command: string } | { stdout, stderr, exitCode } |
readFile | { path: string } | { content } or { error } |
writeFile | { path, content } | { path } (auto-mkdirs parent) |
editFile | { path, oldString, newString, replaceAll? } | { path, occurrences } or { error } |
ls | { path: string } | { files: { path, is_dir }[] } or { error } |
writeFile always succeeds for new paths and overwrites existing ones; if you want create-only semantics (error when the file exists), wrap it yourself.
Examples
examples/typescript/agents/vercel/ram_vercel.ts, RAM-only sandbox driven bygpt-5.4-mini.