Skip to main content
A TypeScript or JavaScript agent is built from its folder into an image with the Node.js version you choose and your dependencies installed. You do not write a Dockerfile, and you do not need a build script.

Package managers

The lockfile decides which package manager installs your dependencies, with a frozen install, so the build gets exactly what your lockfile says: Development dependencies are installed too, so build.commands can use them. See Dependencies.

TypeScript runs directly

Onecortex never runs your own tsc. It bundles your entrypoint and everything it imports from your own code into one file, for the Node.js version you chose, with inline source maps so a stack trace in your logs points at your source. Your dependencies stay in node_modules and load from there, so native modules keep working. This means path aliases, ESM and CommonJS, and tsconfig.json project references all work without a build step. If your agent needs one anyway, such as code generation, declare it:
agent.yml
build.commands runs after your dependencies are installed and before the bundle, in the agent folder, with no configuration or secrets available.

Your agent’s own files

The whole agent folder is in the image, and it is the working directory. An agent that reads a prompt or a data file at run time finds it where it is in your repository:
agent.ts

The architecture

Every agent runs on 64 bit ARM Linux. A dependency with a native binary needs a build for linux-arm64, which most publish.
Last modified on September 28, 2026