Skip to main content
The OpenAI Agents SDK (@openai/agents) ships shellTool and applyPatchTool primitives that take pluggable Shell and Editor backends. Mirage provides MirageShell and MirageEditor implementations that route every command and patch through your Workspace instead of the host shell. mirageReadFileTool adds agent-initiated file reads with structured model input for text, images, and PDFs.

Install

@struktoai/mirage-agents/openai is runtime-agnostic. Pair it with @struktoai/mirage-node for Node or @struktoai/mirage-browser for the browser.

Usage

The examples also support OpenAI-compatible providers. Set OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL; a custom base URL defaults to Chat Completions, uses mirageExecuteTool, and disables OpenAI tracing so the third-party key stays with that provider. Set OPENAI_API=responses when a compatible endpoint implements the Responses API and the examples will use OpenAI’s hosted shell and editor tools instead.

Exports

Unsupported binary formats return a metadata description instead of being decoded as corrupt text. The tool reads raw workspace bytes, so files mounted from RAM, S3, and other Mirage resources use the same model-input path.

Examples