Note: JSR is frozen at 4.5.x. From 5.0.0,
@eserstack/ajanis published on npm under the same name (pnpm add @eserstack/ajan); the JSR versions stay available but get no updates.
eserstack Library — eser/stack on GitHub Install:
pnpm add @eserstack/ajan
C-shared library and WASM module exposing the eser Go runtime bridge. On Node it
loads the native library through the built-in node:ffi module, and falls back
to the WASM build when node:ffi cannot load.
# 1. Build the shared library for your platform (from the repository root)
make ajan-lib
# 2. Verify the Go bridge works
node --run cli -- ajan version
# prints the repository's VERSION, the dispatcher ABI and the backend
# 3. (Optional) Load an explicit library file from a script
ESER_AJAN_LIB_PATH=$(pwd)/pkg/@eserstack/ajan/dist/aarch64-darwin/libeser_ajan.dylib \
node --input-type=module --eval 'import * as ffi from "./pkg/@eserstack/ajan/ffi/mod.ts"; const lib = await ffi.loadEserAjan(); console.log(lib.handshake.version); lib.close();'
# 4. (Optional) Test the WASM fallback
make ajan-wasm
ESER_AJAN_NATIVE=disabled node --run cli -- ajan versionloadEserAjan() opens the native library through node:ffi and falls back to
WASM when node:ffi or the native library cannot be loaded:
import * as ajan from "@eserstack/ajan";
const lib = await ajan.loadEserAjan();
console.log(lib.handshake.version, lib.backend);
const encoded = lib.call("formatEncode", { format: "yaml", data: { a: 1 } });
console.log(encoded.result);
const walk = lib.stream("codebaseWalkFilesStream", { dir: "." });
for (let file = walk.read(); file !== null; file = walk.read()) {
console.log(file.path);
}
walk.close();
lib.close();Every name the bridge serves is an entry of the binding table in
ffi/bindings.ts: its kind (call or stream), whether it can block, whether
the WASM fallback serves it, and its request and answer types. lib.call(name, request) runs a call; lib.stream(name, request) opens a stream whose
read() answers the next chunk, or null when the stream is done, and whose
close() releases it. A request is an object, or the bare handle string for
the few names that take only a handle (logClose, httpClose,
aiCloseModel).
Both answer the bridge function's parsed JSON, an answer with an error field
included, so each package keeps its own error mapping. They throw only when no
bridge function ran, with the dispatcher's code: UnknownFunctionError for
UNKNOWN_FUNCTION, UnsupportedInWasmError for UNSUPPORTED_IN_WASM, and
AjanCallError for the others. The library stays loaded after either.
The names marked async answer a promise on every backend; await them. They
are the blocking calls, the opens of aiTextStream and httpRequestStream,
and every read of a blocking stream (see Worker threads).
On the WASM fallback, httpRequest and httpRequestStream wait on the host's
fetch. For tests, @eserstack/ajan/ffi/fake builds a library whose names are
answered by handlers.
node:ffi calls are synchronous, so a call that waits on the network, a child
process or the terminal would hold the event loop for as long as it waits. The
binding table marks those names blocking, and the native library runs them in
node:worker_threads workers that open the library with their own dlopen
and answer by message (decision-37, ffi/offload.ts). The main thread stays
free: with 8 one-second shellExec calls in flight, a 10 ms timer ran at most
11 ms late and a small file read took under 1 ms on macOS arm64 (idle
machine), against 8.2 s of lateness with the calls on the main thread.
The blocking names:
| Domain | Calls (in the pool) | Streams (one worker each) |
|---|---|---|
| AI | aiGenerateText, aiBatchCreate, aiBatchGet, aiBatchList, aiBatchDownload, aiBatchCancel |
aiTextStream |
| HTTP | httpRequest |
httpRequestStream |
| Shell | shellExec |
shellExecStream, shellPtyStream, shellTuiKeypressStream |
| Kit | kitListRecipes, kitApplyRecipe, kitCloneRecipe, kitNewProject, kitUpdateRecipe |
|
| Posts | postsCompose, postsGetTimeline, postsSearch |
|
| Workflows | workflowRun |
- A blocking call runs in a bounded pool of at most 8 workers. A call that
finds every worker busy waits in a queue, and a worker idle for 30 s ends.
Set the bound with
ESER_AJAN_POOL_SIZE(it takes precedence) orloadEserAjan({ poolSize }), a whole number from 1 to 64; another value throws aRangeError.lib.workers()reports the bound and the counts. - Each open blocking stream gets its own worker for its reads, and for the open
of
aiTextStreamandhttpRequestStream, which wait on the network. The opens of the shell streams are spawns and stay synchronous, soshellExecStreamandshellPtyStreamstill hand out the pid at once. The worker ends when the stream closes or reads to its end. - Every other name runs synchronously on the calling thread:
version,init, the Log calls,aiCancelRequest, everycloseand*Closecall, the PTY write, resize and kill,shellTuiGetSizeand the in-memory crypto, formats and parsing calls. A Log call never posts a worker message. - A worker holds the process open only while it has a job. Under the
permission model, starting a worker needs
--allow-worker; without it the blocking names run on the calling thread, as before.
Pass { signal } as the last argument of a blocking call, a stream open or a
read. When it fires, the main thread runs the name's cancel entry, which ends
the blocked Go call, and the promise rejects with the signal's reason (an
AbortError for controller.abort()):
| Name | Cancel entry |
|---|---|
aiGenerateText, the five aiBatch* |
aiCancelRequest with the request's requestId |
aiTextStream |
aiCancelRequest with the open's requestId |
httpRequestStream |
the stream's close |
shellExecStream |
the stream's close (it ends the child) |
shellPtyStream |
shellPtyKill with SIGKILL |
shellTuiKeypressStream |
the stream's close |
The library adds a requestId to every AI request that has none. A blocking
call without a cancel entry (httpRequest, shellExec, the kit and posts
calls, workflowRun) rejects at once, and its worker stays busy until the Go
call returns, bounded by the call's own timeout.
import * as ajan from "@eserstack/ajan";
const lib = await ajan.loadEserAjan({ wasm: false });
const pty = lib.stream("shellPtyStream", { command: "sh" });
const controller = new AbortController();
setTimeout(() => controller.abort(), 5_000);
try {
const chunk = await pty.read({ signal: controller.signal });
console.log(chunk);
} finally {
pty.close();
lib.close();
}lib.close() runs the cancel entry of every blocking name still in flight,
then ends the workers; what was in flight rejects. A process that exits with
the library open runs those cancel entries too, because Node ends a worker
only after its native call returns: without them, process.exit() with a PTY
read in flight would wait for the PTY's child. ffi/teardown.ffi.test.ts runs
50 child processes that load the library, run blocking calls and exit, with
and without closing it first, and each exits with 0 and no signal.
A second dlopen in a worker reaches the main thread's Go image, so a handle
opened on one thread is read on the other. Node closes the library when a
worker ends, so on macOS the library pins itself with RTLD_NODELETE
(pin_image_posix.go; Linux gets NODELETE from the Go linker). The M0-T2
spike (TASK-175) saw worker teardown hang without the pin; the teardown test
closes the main thread's handle first, so the last handle goes away in a
worker.
One process cannot share its terminal between Go and Node (TASK-175,
measurement (d)). When Node first touches process.stdin on a TTY it reopens
the terminal, which silently ends a Go reader of os.Stdin (the
shellTuiKeypressStream reader) and, on macOS, blocks Node's main thread
until Go's pending read returns. SIGWINCH reaches only the side that installed
its handler last, since Go does not forward the signal. Under Node the
terminal therefore belongs to Node: @eserstack/shell/tui reads keys,
raw mode and resizes through Node (readTerminalEvents, withRawMode,
terminal.getTerminalSize), and its PTY test checks that each key reaches
exactly one reader and that a resize arrives in raw mode.
shellTuiKeypressStream, shellTuiSetStdinRaw and shellTuiGetSize remain
for a host where Go alone owns the terminal; there, a close waits up to 2 s for
a read parked in stdin.
loadEserAjan() tries two steps, in this order (decision-37):
- The native library through
node:ffi. The module is on by default since Node 26.9 and prints anExperimentalWarningon first use. Under the permission model (--permission), grant it with--allow-ffi. - The WASM build (
eser-ajan.wasm, see WASM Usage), when step 1 fails: Node before 26.9, a process started with--no-experimental-ffi, a missing library, or--permissionwithout--allow-ffi.
When both fail, the error names both causes, the flags above and
ESER_AJAN_LIB_PATH. Calls through node:ffi are synchronous; the blocking
names run in worker threads (see Worker threads).
# Run with node:ffi turned off, so the WASM build serves the calls
NODE_OPTIONS=--no-experimental-ffi node --run cli -- ajan versionloadEserAjanSync() is loadEserAjan() for code that cannot be async, such as
a function that returns a value synchronously. It takes the same arguments and
options, follows the same loader order, honours the same environment variables
(ESER_AJAN=disabled throws the same error) and returns the same library:
import * as ajan from "@eserstack/ajan";
const lib = ajan.loadEserAjanSync();
console.log(lib.backend, lib.call("formatList").formats?.length);
lib.close();The two loaders share their opens. Whichever runs first opens the library and
the other gets that library, also when loadEserAjanSync() runs while a
loadEserAjan() is still in flight: the sync loader opens it at once, and the
async one returns it when it reaches its own dlopen or instantiation step. A
WASM module the async loader compiled meanwhile is dropped unused.
The sync loader takes node:ffi, node:fs and node:wasi through
process.getBuiltinModule, so it runs on Node only. Its WASM fallback compiles
the module on the calling thread (new WebAssembly.Module) and blocks it for
the whole load. Measured on an Apple M4 Max with Node 26.12.1 and the
7,623,997-byte module, each figure from a fresh process:
| Step | Time |
|---|---|
new WebAssembly.Module alone |
~4 ms |
loadEserAjanWasmSync(): read, compile, instantiate, Go runtime start and handshake |
~31 ms |
The first call after it (formatList) |
~1 ms |
V8 compiles the function bodies lazily, so the compile itself is short and
part of its cost moves to the first calls. loadEserAjanWasm() takes about the
same wall time (~32 ms) but compiles off the thread. The native load through
node:ffi (dlopen and handshake) took ~4 ms on the same machine.
The shared client in @eserstack/ajan/ffi/client builds on it: ensureLibSync()
loads the bridge once without awaiting and never throws, and requireLibSync()
loads it on first use when no load has finished, then returns the library or
throws the load failure as cause.
The Makefile at the repository root builds the library with Go and a C compiler;
nothing else is needed (decision-40). Every target sets GOWORK=off and stamps
main.Version from VERSION.
make ajan-lib # the library for this host
make ajan-lib TARGET=x86_64-linux # one target, with its cross-compiler
make ajan-all # every native target, then the WASM modules
make ajan-wasm # the WASM reactor of the wasi profile only
make ajan-packages # copy dist/ into the @eserstack/ajan-* packages
make ajan-clean # remove dist/ and the staged binaries| Target | GOOS/GOARCH | Output file |
|---|---|---|
x86_64-linux |
linux/amd64 | libeser_ajan.so |
aarch64-linux |
linux/arm64 | libeser_ajan.so |
x86_64-darwin |
darwin/amd64 | libeser_ajan.dylib |
aarch64-darwin |
darwin/arm64 | libeser_ajan.dylib |
x86_64-windows |
windows/amd64 | libeser_ajan.dll |
wasi |
wasip1/wasm | eser-ajan.wasm |
Cross-compilation for native targets requires the appropriate C cross-compilers
(e.g., x86_64-linux-gnu-gcc, aarch64-linux-gnu-gcc,
x86_64-w64-mingw32-gcc, and clang -arch x86_64 for Intel macOS). The table
is in the Makefile and in targets.ts, which makefile-targets.test.ts keeps
in step. WASM targets need no C compiler (CGO_ENABLED=0).
The library ships in the @eserstack/ajan-* npm platform packages, one per
native target, plus @eserstack/ajan-wasm for the WASM modules. Each holds the
shared library and its C header libeser_ajan.h; make ajan-packages stages
them from dist/.
The shared library exports the dispatcher ABI (ABI 3, dispatch.go): six
functions, the same on every platform. Any language with FFI or ctypes support
can call it directly.
| Export | Answers |
|---|---|
EserAjanVersion() |
The handshake JSON: version, abi, profile, names, streams |
EserAjanCall(name, request) |
The envelope of one call |
EserAjanStreamOpen(name, request) |
The envelope of a stream open; its result carries handle |
EserAjanStreamRead(handle) |
The envelope of the next chunk; a result of null ends it |
EserAjanStreamClose(handle) |
The envelope of the close |
EserAjanFree(ptr) |
Releases a string any of the above returned |
name is a name of the Go dispatch registry, such as cryptoHash, and
request is a string: JSON for most names, the bare handle for the few that
take only a handle, empty for the ones that take nothing. Writes, resizes,
kills, pushes and cancels on an open stream are calls that take the handle in
their request (shellExecWrite, shellPtyResize, parsingTokenizeStreamPush,
kitExtractTarballStreamPush, aiCancelRequest).
Every operation answers an envelope:
{"ok": true, "result": "{\"hash\":\"2cf24d...\"}"}
{"ok": false, "code": "HANDLER_ERROR", "error": "...", "result": "{\"error\":\"...\"}"}
{"ok": false, "code": "UNKNOWN_FUNCTION", "error": "unknown function: cryptoHashh"}result is the bridge function's JSON answer. An answer with an error field
fails the envelope with HANDLER_ERROR and stays in result; a Go panic does
the same with PANIC, and the process keeps running. An envelope without
result means no bridge function ran: UNKNOWN_FUNCTION,
UNSUPPORTED_IN_WASM, KIND_MISMATCH (a call on a stream name or the other way
round), UNKNOWN_HANDLE or BAD_REQUEST (a request nested deeper than the
limit below). A host checks abi in the handshake right after loading the
library; the TypeScript loader refuses a library with another ABI version and
names both versions.
#include "libeser_ajan.h"
#include <stdio.h>
int main(void) {
char* handshake = EserAjanVersion();
printf("%s\n", handshake);
EserAjanFree(handshake);
char* hash = EserAjanCall("cryptoHash", "{\"text\":\"hello\"}");
printf("%s\n", hash);
EserAjanFree(hash);
return 0;
}gcc -o example example.c -L. -leser_ajan
LD_LIBRARY_PATH=. ./example # Linux
DYLD_LIBRARY_PATH=. ./example # macOSimport ctypes, json, sys
ext = {"linux": ".so", "darwin": ".dylib", "win32": ".dll"}[sys.platform]
lib = ctypes.cdll.LoadLibrary(f"./libeser_ajan{ext}")
lib.EserAjanCall.restype = ctypes.c_void_p
lib.EserAjanCall.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
lib.EserAjanFree.argtypes = [ctypes.c_void_p]
ptr = lib.EserAjanCall(b"cryptoHash", b'{"text":"hello"}')
print(json.loads(ctypes.string_at(ptr)))
lib.EserAjanFree(ptr)extern "C" {
fn EserAjanVersion() -> *mut std::os::raw::c_char;
fn EserAjanCall(
name: *const std::os::raw::c_char,
request: *const std::os::raw::c_char,
) -> *mut std::os::raw::c_char;
fn EserAjanFree(ptr: *mut std::os::raw::c_char);
}rustc example.rs -L . -l eser_ajanrequire "fiddle/import"
module EserAjan
extend Fiddle::Importer
dlload "./libeser_ajan.so"
extern "void* EserAjanCall(char*, char*)"
extern "void EserAjanFree(void*)"
end
ptr = EserAjan.EserAjanCall("cryptoHash", '{"text":"hello"}')
puts ptr.to_s
EserAjan.EserAjanFree(ptr)Full working examples live in examples/.
The WASM build is one module, eser-ajan.wasm: the slim "wasi" profile of the
bridge, built with -buildmode=c-shared as a reactor (decision-45). It serves
the 59 names that work on wasip1 (formats, crypto, config, parsing and its
stream, collector, codebase walks, validators and checks with their streams,
cache, csGenerate, logging, HTTP), the ones the binding table marks wasm: "yes" or "fs"; every other name answers UNSUPPORTED_IN_WASM, and the
TypeScript loader refuses the names marked "no" without calling the module. The noskills names left the profile with TASK-258: the
full spec lifecycle would take the module past its size limit. Loggers write
their records to the instance's stderr. make ajan-wasm-check fails when the
module grows past 9 MB, or 1.75 MB with brotli, or links aifx, the vendor AI
SDKs, gRPC, protobuf, QUIC, os/exec, net/http or the OpenTelemetry SDK.
The module exports _initialize, memory and five functions (dispatcher ABI
3, the same envelope as the native exports):
eser_ajan_alloc(size)returns a pointer tosizebytes of an input arena.eser_ajan_call(namePtr, nameLen, argsPtr, argsLen)runs one operation. The host writes the name, then the arguments, into the arena; each argument is a little-endian uint32 byte count followed by its bytes. A registry name is a call and takes one argument, its request; the reserved namesstream.open(stream name, request),stream.read(handle) andstream.close(handle) are the stream operations. It returns the length of the envelope.eser_ajan_result_ptr()points at that envelope until the next call.eser_ajan_call_asyncandeser_ajan_async_result_ptr()are the same for the calls that wait on the host, with their own result buffer.
wasip1 cannot open a socket, so the HTTP names (httpCreate, httpRequest,
the httpRequestStream stream, httpClose) ask the host through the module's
eser_host imports, which the loader provides on the runtime's fetch
(decision-45, TASK-277). With JSPI (WebAssembly.Suspending, on in Node 26 and
workerd), the module waits on the host's promise; the loader calls these names
through WebAssembly.promising, so httpRequest and the httpRequestStream
open and reads return promises (the table marks them async). They run one at a time; other calls go on while one waits.
Without JSPI the HTTP names answer an error.
The answers match the native bridge's, with its retry and circuit-breaker rules, and these differences:
- the host follows redirects only within the same scheme (at most 20), and drops
AuthorizationandCookiewhen the host changes; - a header sent more than once arrives joined by
,, where the native bridge keeps the first value; - a timeout is reported in the host's words;
- a request JSON with a
requestIdfrom@eserstack/ajan/ffi/request-signalsstops when its AbortSignal fires (the Go-backed httpclient takes asignal); the native library ignores it.
The module does not link net/http, which would pull in crypto/tls (+7.3 MB
measured); it speaks to the host directly.
The version call answers the same handshake as the native EserAjanVersion,
with the profile wasi and its 59 names, which the TypeScript loader checks
once at load. loadEserAjanWasm() compiles the module
once, keeps one instance (so handles survive between calls), replaces it after a
trap, and gives it a preopen of the working directory when node:wasi is
available, which the filesystem functions need.
import * as wasm from "@eserstack/ajan/wasm";
const lib = await wasm.loadEserAjanWasm();
console.log(lib.handshake.names.length); // 59
lib.call("shellExec", { command: "true" }); // throws UnsupportedInWasmErrorloadEserAjanWasmSync() loads the same module without awaiting; it compiles
on the calling thread (see Load without awaiting).
The bridge refuses JSON and YAML (and TOML) nested deeper than 1,000 levels,
MaxNestingDepth in ajan/formatfx, with error
JSON that names the limit. The dispatcher checks every JSON request before a
function decodes it, and formatfx checks documents before it decodes them.
Decoding recurses once per level, and in the WASM build a few thousand levels
overflow the host's stack, which Go cannot recover from; the limit keeps the
instance alive.
cd pkg/@eserstack/ajan
GOOS=wasip1 GOARCH=wasm CGO_ENABLED=0 go build -buildmode=c-shared \
-tags eserajan_wasi -trimpath -o eser-ajan.wasm .Environment variables switch off steps of the loader order. Set any of these
to disabled to skip the corresponding step:
| Variable | Effect |
|---|---|
ESER_AJAN=disabled |
Disable both steps (native + WASM); loadEserAjan() throws immediately |
ESER_AJAN_NATIVE=disabled |
Skip node:ffi; go straight to the WASM fallback |
ESER_AJAN_WASM=disabled |
Disable the WASM fallback; only try node:ffi |
# Force WASM-only (skip node:ffi)
ESER_AJAN_NATIVE=disabled node --run cli -- ajan version
# Disable all (useful for testing error paths)
ESER_AJAN=disabled node --run cli -- ajan version
# Native only, no WASM fallback (for CI)
ESER_AJAN_WASM=disabled node --run cli -- ajan versionloadEserAjan() also accepts a LoadOptions object:
import * as ajan from "@eserstack/ajan";
// Skip native, use WASM only
const wasmOnly = await ajan.loadEserAjan({ native: false });
wasmOnly.close();
// Native only, no WASM fallback
const nativeOnly = await ajan.loadEserAjan({ wasm: false });
nativeOnly.close();
// Explicit path
const explicit = await ajan.loadEserAjan("path/to/libeser_ajan.dylib");
explicit.close();Environment variables always take precedence over programmatic options. If
ESER_AJAN_NATIVE=disabled is set, { native: true } will NOT re-enable
node:ffi.
Set ESER_AJAN_DEBUG to any value to print, on stderr, why a step was skipped
or failed. Nothing is printed while it is unset.
| Variable | Default | Purpose |
|---|---|---|
ESER_AJAN_LIB_PATH |
unset: search the locations below | Full path of the native library, e.g. /opt/eser/libeser_ajan.so |
ESER_AJAN_WASM_PATH |
unset: search the locations below | Full path of the WASM module, e.g. /opt/eser/eser-ajan.wasm |
ESER_AJAN_DEBUG |
unset: no diagnostics | Any value prints loader order diagnostics on stderr, e.g. 1 |
ESER_AJAN_POOL_SIZE |
8 |
Pool workers for the blocking calls, 1 to 64, e.g. 4 |
None is required. Without an override, the native library is looked up next to
the module, in dist/, in the @eserstack/ajan-{platform} package and in
/usr/local/lib and /usr/lib; the WASM module next to the module, in dist/,
in @eserstack/ajan-wasm and in the same system directories.
# Go bridge
cd pkg/@eserstack/ajan && go test -race ./...
# TypeScript loaders
node --test --test-force-exit pkg/@eserstack/ajan/These changes since 4.5.2 need a change in code, commands or files that use this package. The changelog lists the changes in every package.
-
The library exports the six functions of the dispatcher ABI instead of the 99
EserAjan*exports, andFFILibrary.symbolsis gone. Before: theEserAjanCryptoHashsymbol with a JSON string in and a JSON string out. After:lib.call("cryptoHash", req)with an object in and the parsed answer out. A C, Python or Rust host callsEserAjanCall("cryptoHash", requestJson)and readsresultfrom the envelope. The names are the dispatch names inffi/bindings.ts. -
The stream exports became streams:
aiStreamText,aiStreamReadandaiFreeStreamarelib.stream("aiTextStream", ...)withread()andclose(); likewisehttpRequestStream,shellExecStream(wasshellExecSpawn),shellPtyStream(wasshellPtySpawn),shellTuiKeypressStream(wasshellTuiKeypressCreate),codebaseWalkFilesStream,codebaseValidateFilesStreamandparsingTokenizeStream(its chunks still go in throughparsingTokenizeStreamPush, andclose()answers the flushed tokens). -
aiGenerateTextand theaiTextStreamopen take one request,{ modelHandle, options }, instead of a handle and an options JSON. -
versionanswers the handshake JSON instead ofeser-ajan version X, andinitandshutdownanswer{}instead ofinitializedandshutdown; read the version fromlib.handshake.version. -
The WASM module speaks ABI 3: a host of ABI 2 refuses it, and the stream names go through
stream.open,stream.readandstream.close. -
The blocking names answer promises:
lib.callof a blocking call, theaiTextStreamopen and every read of a blocking stream. Before:const reply = lib.call("shellExec", req). After:const reply = await lib.call("shellExec", req); likewiseawait stream.read()forshellExecStreamandshellPtyStream.FFILibraryhas a new member,workers(); an object that implements the interface by hand needs it. -
The bridge runs on Node only, through
node:ffiwith the WASM build as the fallback; the other runtime backends and their native npm dependency are gone. Run on Node 26.9 or later, and pass--allow-ffiunder--permission. -
LoadOptions.backends,detectRuntime(),selectBackend()and theFFIBackendandRuntimeIdtypes are removed. DropbackendsfromloadEserAjan()calls;nativeandwasmstill choose the steps. -
@eserstack/ajan/wasmprobes files withprocess.getBuiltinModule("node:fs"), asffi/resolve.tsdoes. On a host without it (browsers),loadEserAjanWasm()withoutwasmPaththrows "Could not find eser-ajan WASM module". PasswasmPath. -
The WASM resolver no longer looks for
eser-ajan.wasm.bin. Rename such a copy toeser-ajan.wasm, or pointESER_AJAN_WASM_PATHat it. -
The WASM fallback is one module,
eser-ajan.wasm, the wasi-profile reactor. The per-call module that read a JSON request on stdin,eser-ajan-reactor.wasmand themodeoption ofloadEserAjanWasm()andresolveWasmPath()are gone; dropmodefrom calls. Names outside the profile throwUnsupportedInWasmError(codeUNSUPPORTED_IN_WASM) instead of failing per call. -
shellExecstops a command after 10 minutes when the request has notimeout, and rejects a zero or negativetimeoutbefore the command starts. Before:{"timeout": "0s"}meant no limit. After: omittimeoutfor the default, or send a positive Go duration such as"30m". -
httpRequestreturns the status and headers with an error and no body for a response over 32 MiB, andhttpRequestStreamreads error-status bodies under the same limit. SendmaxResponseBytesin the request JSON, or use the stream variant. -
codebaseValidateFilesand its stream variant fail the request for malformedvalidatorOptionsoffilenamesorlarge-file, andlarge-fileappliesmaxKb; it was always 1024 KB. -
On the WASM fallback, a git-aware
codebaseWalkFiles,codebaseValidateFilesor one of their streams fails unless the request carriesgitFiles, the host'sgit ls-files --cached --others --exclude-standardlisting fordir, since the module cannot start git;@eserstack/codebasesends it. -
noskillsInitwritescommand: npx eser@latest noskills(noskillsfx.DefaultCommandPrefix) into a new manifest instead ofnoskills. Edit the manifest'scommandto keep a barenoskills.
- npm package
examples/: C, Python, Rust and browser programs that call the library- @eserstack/ajan-wasm and the platform packages such as @eserstack/ajan-linux-x64: the prebuilt binaries
- eser/stack on GitHub