---
title: "oneecma cookbook"
url: https://recursiveai.org/oneecma/cookbook/
description: "Short recipes for common OneEcma tasks, each with complete code you can copy."
version: "1.0.0"
---

# oneecma cookbook

Short recipes for common OneEcma tasks, each with complete code you can copy.

## Recipes

- [Run untrusted JavaScript with limits](https://recursiveai.org/oneecma/cookbook/sandbox/index.md): Run JavaScript you don’t trust from C# with OneEcma: a fresh engine per script, a step budget, an allocation budget, a wall-clock deadline, a call-depth…
- [Call C# from JavaScript](https://recursiveai.org/oneecma/cookbook/host-functions/index.md): Give scripts C# functions with OneEcma’s host API: plain functions, .NET exceptions that scripts can catch, tasks that become promises, and script values…
- [Expose .NET objects with [JsExport]](https://recursiveai.org/oneecma/cookbook/jsexport/index.md): Mark C# classes, records and enums with [JsExport] and OneEcma’s source generator writes the bindings at build time: methods, properties, async methods…
- [Give scripts tools from a JSON Schema](https://recursiveai.org/oneecma/cookbook/json-schema-tools/index.md): Register host functions whose argument is checked against a JSON Schema before your C# handler runs, the way an agent host exposes its tools to…
- [Error reports: text, compact and JSON](https://recursiveai.org/oneecma/cookbook/error-reports/index.md): Get OneEcma’s report for a failed script in each of its forms: the full text report, the same with each frame’s local variables, a compact rendering sized…
- [Run code a model wrote](https://recursiveai.org/oneecma/cookbook/run-model-code/index.md): Run JavaScript that an LLM wrote as a tool call: check it and apply safe syntax repairs, run it as an async function body under limits, and hand the model…
- [Point reports at the original source with source maps](https://recursiveai.org/oneecma/cookbook/source-maps/index.md): Run minified or bundled JavaScript with OneEcma and turn its error report back into one about the TypeScript you wrote: the location, the source line and…
- [The oneecma command](https://recursiveai.org/oneecma/cookbook/command-line/index.md): Run, check and repair JavaScript from a terminal or a CI job with the oneecma command: the same reports as the library on stderr, JSON on stdout, exit…
- [Record a failed run and replay it](https://recursiveai.org/oneecma/cookbook/record-replay/index.md): Save the record log of a JavaScript run that failed in production and replay it anywhere with OneEcma: the same clock readings, random numbers and…
- [Move from Jint or ClearScript](https://recursiveai.org/oneecma/cookbook/migrate-from-jint-clearscript/index.md): Move a .NET host from Jint or ClearScript to OneEcma: how engine creation, limits, exposing functions and objects, running code and catching errors map…
