Ajo Engine
Seal and run
Install the native pair, seal a Kit build and run it.
This page takes a Kit application, here a small notes App, from kit build to a running engine process. Sealing and running happen on a verified Linux x64 host. UI development can happen elsewhere; only these steps need the native tools.
Install the native pair
Install the runtime and the compiler together, at the same exact version, as optional dependencies of the App: the compiler runs on the build host, and the runtime binary later goes into the App’s image.
pnpm add --save-optional --save-exact ajo-engine@0.2.0 ajo-engine-compiler@0.2.0Installation never compiles or downloads anything. Neither package has lifecycle scripts, a JavaScript launcher, a downloader or runtime npm dependencies. Each contains one executable, its PIN, checksums, provenance record, the ISC license and the third-party notices. Keep the lockfile from this installation so later builds use the same pair.
Where the toolchain runs
Both packages declare Linux and x64. pnpm skips an optional dependency whose declared OS or CPU does not match the machine, so on macOS or Windows the same project installs without the pair and UI development works as usual; no support is claimed there. Seal and run on a verified Linux host, such as a dedicated Linux environment or virtual machine, from the same lockfile.
Build and seal
kit build has a single target, the engine. It writes a staging tree to .ajo/, described in Build and configuration. When the project has ajo-engine-compiler installed, Kit then removes any previous dist/ajo and runs the compiler on the staged descriptor, which seals a fresh one:
pnpm kit build✓ Staged .ajo
✓ Sealed dist/ajoWithout the compiler, where pnpm skipped the pair or before it is installed, the build stops after staging and still succeeds; it says it did not seal:
✓ Staged .ajo
○ Not sealed: ajo-engine-compiler is not installed
next: On Linux x64, pnpm add --save-optional --save-exact ajo-engine ajo-engine-compiler, then pnpm kit buildThe descriptor is the handoff contract between Kit and the compiler: the module graph, the client assets and the App’s declared authority. The artifact explains what the compiler does with it.
Debug seals
kit build passes no options to the compiler, so run it yourself on the staged descriptor, with an output path that does not exist yet, for a seal that keeps its source. Source stripping explains what that changes and why it stays out of production.
pnpm exec ajo-engine-compiler --keep-source --input .ajo/compiler.json --output .ajo/debugRun the artifact
ajo-engine takes the artifact directory. Any further arguments are passed to the application. The process reads its configuration from the environment:
NODE_ENV=production HOST=127.0.0.1 PORT=8080 APP_URL=http://localhost:8080 \
pnpm exec ajo-engine dist/ajoKit declares NODE_ENV and APP_URL as required in every descriptor, and an App adds its own names under kit.engine.env. A required name that is missing at startup stops the engine before any application code runs; Production environment lists every variable. Refusals are printed on standard error and name what is missing:
[ajo] [error] artifact requires environment variable 'MAIL_URL'The data root
An App that stores SQLite on disk also needs a writable data root in AJO_DATA, inside a declared filesystem root; Data on disk walks through it. An App with ajo-kit-server installed also declares /ajo/origin, so a direct run needs that directory as well; see Origins and CSRF.
Before you package it
- The runtime and compiler come from the same release; the artifact’s pin matches the runtime’s.
- The artifact was sealed without
--keep-source. - Every required variable, the data root and each declared root exist where the App will run.
- The runtime’s ISC license and third-party notices travel with any image you redistribute.
kit deployincludes them in the App image it writes.
- The artifactManifest fields, the feature scan and fail-closed loading.
- Build and configurationThe Kit side: descriptor configuration and plugins.
- Deploy your first AppSeal, package and deploy an App in one step.
Full reference: ajo-engine on npm, ajo-kit packages/ajo-kit/README.md