# API reference

Maligator 0.1.0-alpha.27 · Experimental
Source revision: 96c331078104a0c9275238dbd0a714f5c48a53b6
Canonical: https://maligator.ddv.tools/api

- [Build configuration](/api/build) — defineBuild, engine features, surfaces, and assets.
- [Application lifecycle](/api/application) — Notify the development supervisor when startup is complete.
- [Execution context](/api/process) — Read immutable compile-time command and configuration values.
- [Workers](/api/workers) — Pools, isolated modules, channels, and transfers.
- [Test API](/api/test) — Tests, suites, hooks, and assertions.
- [Runtime globals](/api/runtime) — Materialize assets with mal and serve HTTP with Mal.
- [CLI](/api/cli) — Commands, flags, defaults, and output paths.

## Build configuration

- [`MaligatorIntlFeature`](/api/build#MaligatorIntlFeature) — Service selections used when Intl is enabled; an empty list includes every service.
- [`AssetInclusion`](/api/build#AssetInclusion) — Capture a regular file or a directory tree at build time. Paths are relative to
the project root. Directory patterns support *, ?, and whole-segment **;
every pattern must match a regular file. Symlinks are rejected.
- [`MaligatorBuildConfig`](/api/build#MaligatorBuildConfig) — Trusted, strictly validated configuration evaluated for each CLI invocation.
- [`defineBuild`](/api/build#defineBuild) — Preserve the inferred config type. Validation happens when the CLI loads the config.

```typescript
import { defineBuild } from "@maligator/cli";
export default defineBuild({ entry: "src/index.ts" });
```

<details><summary>Members and options (19)</summary>

- [`entry`](/api/build#entry)
- [`outputName`](/api/build#outputName)
- [`assets`](/api/build#assets)
- [`modules`](/api/build#modules)
- [`modules.aliases`](/api/build#modules.aliases)
- [`engine`](/api/build#engine)
- [`engine.primordials`](/api/build#engine.primordials)
- [`engine.eval`](/api/build#engine.eval)
- [`engine.realms`](/api/build#engine.realms)
- [`engine.regexp`](/api/build#engine.regexp)
- [`engine.temporal`](/api/build#engine.temporal)
- [`engine.intl`](/api/build#engine.intl)
- [`engine.intl.enabled`](/api/build#engine.intl.enabled)
- [`engine.intl.features`](/api/build#engine.intl.features)
- [`engine.intl.languages`](/api/build#engine.intl.languages)
- [`surface`](/api/build#surface)
- [`surface.webPlatform`](/api/build#surface.webPlatform)
- [`surface.node`](/api/build#surface.node)
- [`surface.maligator`](/api/build#surface.maligator)

</details>

## Application lifecycle

- [`ready`](/api/application#ready) — Notify the development supervisor that this application is ready. Repeated calls are harmless. Returns true in a supervised application and false in a standalone application or ordinary worker. Call after resources such as a server listener are accepting work; this does not reserve ports or transfer traffic.



## Execution context

- [`execution`](/api/process#execution) — An immutable snapshot of the workflow, target, and resolved configuration, fixed before compilation. Known property reads can specialize application branches. Runtime arguments, environment, working directory, and PID are outside this snapshot. Profiling does not change production intent. Static and dynamic imports share its identity, and reflection sees the complete deeply frozen shape.
- [`ExecutionProfile`](/api/process#ExecutionProfile) — Profiling instrumentation: none by default; sampling for --profile; compiler for --profile=compiler. Both profiling modes select full optimization without selecting production application behavior.
- [`ExecutionTarget`](/api/process#ExecutionTarget) — The fixed platform contract of the application image.
- [`ExecutionOptions`](/api/process#ExecutionOptions) — Options shared by build, run, and dev. Output paths, verbosity, and compiler scheduling are tool settings and are not exposed.
- [`TestExecutionOptions`](/api/process#TestExecutionOptions) — Normalized test settings, fixed for the application image. Changing these values invalidates specialized test artifacts.
- [`ExecutionEngineConfig`](/api/process#ExecutionEngineConfig) — Resolved engine policies. These describe build inputs, never post-DCE native feature inclusion.
- [`ExecutionConfig`](/api/process#ExecutionConfig) — Resolved application engine, Web/Node surface, and module policies. Excludes build-host paths, asset declarations, and output controls.
- [`ExecutionCommon`](/api/process#ExecutionCommon) — Fields shared by every execution workflow. All nested objects and arrays are deeply frozen at runtime.
- [`Execution`](/api/process#Execution) — An immutable application-image description, discriminated by command. The command describes the workflow that prepared the image, not a transient process phase.

<details><summary>Members and options (30)</summary>

- [`ExecutionTarget.platform`](/api/process#ExecutionTarget.platform)
- [`ExecutionTarget.arch`](/api/process#ExecutionTarget.arch)
- [`ExecutionTarget.triple`](/api/process#ExecutionTarget.triple)
- [`ExecutionOptions.profile`](/api/process#ExecutionOptions.profile)
- [`TestExecutionOptions.profile`](/api/process#TestExecutionOptions.profile)
- [`TestExecutionOptions.nameFilter`](/api/process#TestExecutionOptions.nameFilter)
- [`TestExecutionOptions.repeat`](/api/process#TestExecutionOptions.repeat)
- [`TestExecutionOptions.bail`](/api/process#TestExecutionOptions.bail)
- [`TestExecutionOptions.timeoutMs`](/api/process#TestExecutionOptions.timeoutMs)
- [`TestExecutionOptions.shuffleSeed`](/api/process#TestExecutionOptions.shuffleSeed)
- [`ExecutionEngineConfig.primordials`](/api/process#ExecutionEngineConfig.primordials)
- [`ExecutionEngineConfig.eval`](/api/process#ExecutionEngineConfig.eval)
- [`ExecutionEngineConfig.realms`](/api/process#ExecutionEngineConfig.realms)
- [`ExecutionEngineConfig.regexp`](/api/process#ExecutionEngineConfig.regexp)
- [`ExecutionEngineConfig.temporal`](/api/process#ExecutionEngineConfig.temporal)
- [`ExecutionEngineConfig.intl`](/api/process#ExecutionEngineConfig.intl)
- [`ExecutionEngineConfig.intl.enabled`](/api/process#ExecutionEngineConfig.intl.enabled)
- [`ExecutionEngineConfig.intl.features`](/api/process#ExecutionEngineConfig.intl.features)
- [`ExecutionEngineConfig.intl.languages`](/api/process#ExecutionEngineConfig.intl.languages)
- [`ExecutionConfig.engine`](/api/process#ExecutionConfig.engine)
- [`ExecutionConfig.surface`](/api/process#ExecutionConfig.surface)
- [`ExecutionConfig.surface.webPlatform`](/api/process#ExecutionConfig.surface.webPlatform)
- [`ExecutionConfig.surface.node`](/api/process#ExecutionConfig.surface.node)
- [`ExecutionConfig.modules`](/api/process#ExecutionConfig.modules)
- [`ExecutionConfig.modules.aliases`](/api/process#ExecutionConfig.modules.aliases)
- [`ExecutionCommon.production`](/api/process#ExecutionCommon.production)
- [`ExecutionCommon.compiled`](/api/process#ExecutionCommon.compiled)
- [`ExecutionCommon.optimization`](/api/process#ExecutionCommon.optimization)
- [`ExecutionCommon.target`](/api/process#ExecutionCommon.target)
- [`ExecutionCommon.config`](/api/process#ExecutionCommon.config)

</details>

## Workers

- [`createPool`](/api/workers#createPool) — Create a bounded pool of persistent workers for a declared entry. Submission failures throw synchronously; admitted tasks settle asynchronously. Await ready before submitting startup-dependent work and close the pool when finished. Throws NotSupportedError without threads and RangeError for invalid bounds.
- [`createWorkerUrl`](/api/workers#createWorkerUrl) — Declare an entry using a static string literal and explicit import.meta.url base. The immutable href projection can be passed to existing worker libraries.
- [`transfer`](/api/workers#transfer) — Wrap a result for transfer when the worker publishes it.
- [`Worker`](/api/workers#Worker) — Start a declared isolated module and expose its ordered port and complete lifecycle.
- [`MessageChannel`](/api/workers#MessageChannel) — Create two transferable endpoints independently of worker startup.
- [`MessagePort`](/api/workers#MessagePort) — The port prototype for type and identity checks. Ports are created by channels and workers.
- [`receiveMessageOnPort`](/api/workers#receiveMessageOnPort) — Synchronously dequeue one pending message without running unrelated callbacks.
- [`capabilities`](/api/workers#capabilities) — Report the running host's worker facilities and capacity.
- [`parentPort`](/api/workers#parentPort) — The worker's parent endpoint; null in the main isolate.
- [`workerData`](/api/workers#workerData) — The worker-owned clone of startup data.
- [`WorkerUrl`](/api/workers#WorkerUrl) — An immutable image-local worker entry declaration. The compiler resolves the declaration independently of how libraries pass the descriptor or its href onward. Erased module types express the caller's assertion; runtime entry identity is validated.
- [`Transferable`](/api/workers#Transferable) — ArrayBuffer stores move at admission. MessagePort endpoints transfer ownership. SharedArrayBuffer is cloned by sharing its backing and cannot be transferred.
- [`TaskContext`](/api/workers#TaskContext) — Cancellation is cooperative while a pool task runs. The worker remains occupied until the task's returned promise settles.
- [`TransferResult`](/api/workers#TransferResult) — An opaque result envelope. Constructing it does not detach buffers; publication commits transfers.
- [`TaskNames`](/api/workers#TaskNames) — Names of context-first exported task functions.
- [`TaskArgs`](/api/workers#TaskArgs) — The task's argument tuple, excluding its local cancellation context.
- [`TaskValue`](/api/workers#TaskValue) — The settled task result after unwrapping an explicit transfer envelope.
- [`PoolOptions`](/api/workers#PoolOptions) — Fixed persistent worker count and admission bounds. Every worker has independent module state. A size-one pool dispatches admitted tasks serially.
- [`RunOptions`](/api/workers#RunOptions) — The transfer list commits synchronously when run returns normally. Validation, saturation, closed pools and already-aborted signals throw before admission.
- [`MapOptions`](/api/workers#MapOptions) — The window bounds pulled inputs and buffered results together. Results are yielded in input order; iterator return cancels this map's work and closes its input.
- [`PoolStats`](/api/workers#PoolStats) — A snapshot of this pool's scheduling and settled operations.
- [`WorkerPool`](/api/workers#WorkerPool) — A bounded task scheduler over isolated persistent workers. Each worker executes one task through asynchronous settlement. No accepted task is replayed after worker failure.
- [`WorkerExit`](/api/workers#WorkerExit) — A terminal record published only after the native worker is joined and its slot is released.
- [`WorkerOptions`](/api/workers#WorkerOptions) — Worker data is snapshotted before startup. The native host bounds live workers and message admission process-wide.
- [`MessageChannelOptions`](/api/workers#MessageChannelOptions) — Each endpoint bounds its pending message count and bytes. Rejection leaves the sender's transferables unchanged.
- [`MessagePort`](/api/workers#MessagePort.type) — An ordered bidirectional endpoint with transactional transfer and bounded queues. Message listeners and values are owned by the receiving isolate.
- [`MessageChannel`](/api/workers#MessageChannel.type) — A standalone channel whose endpoints may be transferred to workers.
- [`Worker`](/api/workers#Worker.type) — A long-lived isolated module and its parent communication port. Startup completes after module evaluation; shutdown completes after native thread reaping.

<details><summary>Members and options (62)</summary>

- [`WorkerUrl.href`](/api/workers#WorkerUrl.href)
- [`WorkerUrl.__workerModule`](/api/workers#WorkerUrl.__workerModule)
- [`TaskContext.signal`](/api/workers#TaskContext.signal)
- [`TaskContext.throwIfCancelled`](/api/workers#TaskContext.throwIfCancelled)
- [`TransferResult.value`](/api/workers#TransferResult.value)
- [`TransferResult.__transferResult`](/api/workers#TransferResult.__transferResult)
- [`PoolOptions.size`](/api/workers#PoolOptions.size)
- [`PoolOptions.maxQueuedTasks`](/api/workers#PoolOptions.maxQueuedTasks)
- [`PoolOptions.maxQueuedBytes`](/api/workers#PoolOptions.maxQueuedBytes)
- [`PoolOptions.maxMessageBytes`](/api/workers#PoolOptions.maxMessageBytes)
- [`PoolOptions.name`](/api/workers#PoolOptions.name)
- [`RunOptions.signal`](/api/workers#RunOptions.signal)
- [`RunOptions.transfer`](/api/workers#RunOptions.transfer)
- [`MapOptions.signal`](/api/workers#MapOptions.signal)
- [`MapOptions.window`](/api/workers#MapOptions.window)
- [`MapOptions.transfer`](/api/workers#MapOptions.transfer)
- [`PoolStats.size`](/api/workers#PoolStats.size)
- [`PoolStats.active`](/api/workers#PoolStats.active)
- [`PoolStats.queued`](/api/workers#PoolStats.queued)
- [`PoolStats.completed`](/api/workers#PoolStats.completed)
- [`PoolStats.failed`](/api/workers#PoolStats.failed)
- [`PoolStats.cancelled`](/api/workers#PoolStats.cancelled)
- [`WorkerPool.ready`](/api/workers#WorkerPool.ready)
- [`WorkerPool.run`](/api/workers#WorkerPool.run)
- [`WorkerPool.map`](/api/workers#WorkerPool.map)
- [`WorkerPool.close`](/api/workers#WorkerPool.close)
- [`WorkerPool.terminate`](/api/workers#WorkerPool.terminate)
- [`WorkerPool.stats`](/api/workers#WorkerPool.stats)
- [`WorkerPool.ref`](/api/workers#WorkerPool.ref)
- [`WorkerPool.unref`](/api/workers#WorkerPool.unref)
- [`WorkerPool.hasRef`](/api/workers#WorkerPool.hasRef)
- [`WorkerExit.id`](/api/workers#WorkerExit.id)
- [`WorkerExit.code`](/api/workers#WorkerExit.code)
- [`WorkerExit.reason`](/api/workers#WorkerExit.reason)
- [`WorkerExit.error`](/api/workers#WorkerExit.error)
- [`WorkerOptions.name`](/api/workers#WorkerOptions.name)
- [`WorkerOptions.data`](/api/workers#WorkerOptions.data)
- [`WorkerOptions.transfer`](/api/workers#WorkerOptions.transfer)
- [`WorkerOptions.maxQueuedMessages`](/api/workers#WorkerOptions.maxQueuedMessages)
- [`WorkerOptions.maxQueuedBytes`](/api/workers#WorkerOptions.maxQueuedBytes)
- [`WorkerOptions.maxMessageBytes`](/api/workers#WorkerOptions.maxMessageBytes)
- [`MessageChannelOptions.maxQueuedMessages`](/api/workers#MessageChannelOptions.maxQueuedMessages)
- [`MessageChannelOptions.maxQueuedBytes`](/api/workers#MessageChannelOptions.maxQueuedBytes)
- [`MessageChannelOptions.maxMessageBytes`](/api/workers#MessageChannelOptions.maxMessageBytes)
- [`MessagePort.postMessage`](/api/workers#MessagePort.postMessage)
- [`MessagePort.onmessage`](/api/workers#MessagePort.onmessage)
- [`MessagePort.onmessageerror`](/api/workers#MessagePort.onmessageerror)
- [`MessagePort.start`](/api/workers#MessagePort.start)
- [`MessagePort.close`](/api/workers#MessagePort.close)
- [`MessagePort.ref`](/api/workers#MessagePort.ref)
- [`MessagePort.unref`](/api/workers#MessagePort.unref)
- [`MessagePort.hasRef`](/api/workers#MessagePort.hasRef)
- [`MessageChannel.port1`](/api/workers#MessageChannel.port1)
- [`MessageChannel.port2`](/api/workers#MessageChannel.port2)
- [`Worker.id`](/api/workers#Worker.id)
- [`Worker.ready`](/api/workers#Worker.ready)
- [`Worker.closed`](/api/workers#Worker.closed)
- [`Worker.port`](/api/workers#Worker.port)
- [`Worker.terminate`](/api/workers#Worker.terminate)
- [`Worker.ref`](/api/workers#Worker.ref)
- [`Worker.unref`](/api/workers#Worker.unref)
- [`Worker.hasRef`](/api/workers#Worker.hasRef)

</details>

## Test API

- [`test`](/api/test#test) — Register a test in the current suite.
- [`describe`](/api/test#describe) — Register a nested suite in the current suite.
- [`expect`](/api/test#expect) — Create fluent matchers for a received value.
- [`beforeAll`](/api/test#beforeAll) — Run once before tests in the current suite.
- [`afterAll`](/api/test#afterAll) — Run once after tests in the current suite, including after test failures.
- [`beforeEach`](/api/test#beforeEach) — Run before every selected descendant test. Ancestor hooks run before hooks
declared by a nested suite.
- [`afterEach`](/api/test#afterEach) — Run after every selected descendant test. Nested-suite hooks run before
ancestor hooks.
- [`TestCallback`](/api/test#TestCallback) — A test or hook body. Maligator waits for a returned promise or thenable before advancing the lifecycle.
- [`HookCallback`](/api/test#HookCallback) — A lifecycle hook body, with the same async completion contract as a test.
- [`Constructor`](/api/test#Constructor) — A constructable value accepted by `expect.any`.
- [`AsymmetricMatcher`](/api/test#AsymmetricMatcher) — Opaque partial-match value produced by helpers such as `expect.objectContaining`. It may be nested inside `toEqual`, `toStrictEqual`, and `toMatchObject` expectations.
- [`Matchers`](/api/test#Matchers) — Matchers for a synchronously received value.
- [`AsyncMatchers`](/api/test#AsyncMatchers) — Promise-returning matcher surface exposed by `Matchers.resolves` and `Matchers.rejects`. Await these calls so the test cannot finish before the assertion.
- [`ExpectFunction`](/api/test#ExpectFunction) — Assertion entrypoint and Maligator-owned asymmetric matcher factories.
- [`TestFunction`](/api/test#TestFunction) — Register tests in the current suite during module evaluation.
- [`DescribeFunction`](/api/test#DescribeFunction) — Register nested suites synchronously during module evaluation.

<details><summary>Members and options (42)</summary>

- [`AsymmetricMatcher.__maligator_asymmetric__`](/api/test#AsymmetricMatcher.__maligator_asymmetric__)
- [`Matchers.not`](/api/test#Matchers.not)
- [`Matchers.resolves`](/api/test#Matchers.resolves)
- [`Matchers.rejects`](/api/test#Matchers.rejects)
- [`Matchers.toBe`](/api/test#Matchers.toBe)
- [`Matchers.toEqual`](/api/test#Matchers.toEqual)
- [`Matchers.toStrictEqual`](/api/test#Matchers.toStrictEqual)
- [`Matchers.toBeDefined`](/api/test#Matchers.toBeDefined)
- [`Matchers.toBeUndefined`](/api/test#Matchers.toBeUndefined)
- [`Matchers.toBeNull`](/api/test#Matchers.toBeNull)
- [`Matchers.toBeTruthy`](/api/test#Matchers.toBeTruthy)
- [`Matchers.toBeFalsy`](/api/test#Matchers.toBeFalsy)
- [`Matchers.toContain`](/api/test#Matchers.toContain)
- [`Matchers.toHaveLength`](/api/test#Matchers.toHaveLength)
- [`Matchers.toMatch`](/api/test#Matchers.toMatch)
- [`Matchers.toMatchObject`](/api/test#Matchers.toMatchObject)
- [`Matchers.toThrow`](/api/test#Matchers.toThrow)
- [`AsyncMatchers.not`](/api/test#AsyncMatchers.not)
- [`AsyncMatchers.toBe`](/api/test#AsyncMatchers.toBe)
- [`AsyncMatchers.toEqual`](/api/test#AsyncMatchers.toEqual)
- [`AsyncMatchers.toStrictEqual`](/api/test#AsyncMatchers.toStrictEqual)
- [`AsyncMatchers.toBeDefined`](/api/test#AsyncMatchers.toBeDefined)
- [`AsyncMatchers.toBeUndefined`](/api/test#AsyncMatchers.toBeUndefined)
- [`AsyncMatchers.toBeNull`](/api/test#AsyncMatchers.toBeNull)
- [`AsyncMatchers.toBeTruthy`](/api/test#AsyncMatchers.toBeTruthy)
- [`AsyncMatchers.toBeFalsy`](/api/test#AsyncMatchers.toBeFalsy)
- [`AsyncMatchers.toContain`](/api/test#AsyncMatchers.toContain)
- [`AsyncMatchers.toHaveLength`](/api/test#AsyncMatchers.toHaveLength)
- [`AsyncMatchers.toMatch`](/api/test#AsyncMatchers.toMatch)
- [`AsyncMatchers.toMatchObject`](/api/test#AsyncMatchers.toMatchObject)
- [`AsyncMatchers.toThrow`](/api/test#AsyncMatchers.toThrow)
- [`expect.any`](/api/test#expect.any)
- [`expect.anything`](/api/test#expect.anything)
- [`expect.stringMatching`](/api/test#expect.stringMatching)
- [`expect.objectContaining`](/api/test#expect.objectContaining)
- [`expect.arrayContaining`](/api/test#expect.arrayContaining)
- [`test.skip`](/api/test#test.skip)
- [`test.todo`](/api/test#test.todo)
- [`test.only`](/api/test#test.only)
- [`test.each`](/api/test#test.each)
- [`describe.skip`](/api/test#describe.skip)
- [`describe.only`](/api/test#describe.only)

</details>

## Runtime globals

- [`MaligatorMaterializeOptions`](/api/runtime#MaligatorMaterializeOptions) — 
- [`MaligatorAssets`](/api/runtime#MaligatorAssets) — 
- [`MaligatorRuntime`](/api/runtime#MaligatorRuntime) — 
- [`MaligatorServeOptions`](/api/runtime#MaligatorServeOptions) — 
- [`MaligatorServer`](/api/runtime#MaligatorServer) — 
- [`MaligatorWebRuntime`](/api/runtime#MaligatorWebRuntime) — 
- [`mal`](/api/runtime#mal) — Core namespace, available when surface.maligator is enabled.
- [`Mal`](/api/runtime#Mal) — Web host namespace, available when surface.webPlatform is enabled.

<details><summary>Members and options (12)</summary>

- [`MaligatorMaterializeOptions.baseDirectory`](/api/runtime#MaligatorMaterializeOptions.baseDirectory)
- [`mal.assets.materialize`](/api/runtime#mal.assets.materialize)
- [`MaligatorRuntime.assets`](/api/runtime#MaligatorRuntime.assets)
- [`MaligatorServeOptions.hostname`](/api/runtime#MaligatorServeOptions.hostname)
- [`MaligatorServeOptions.port`](/api/runtime#MaligatorServeOptions.port)
- [`MaligatorServeOptions.fetch`](/api/runtime#MaligatorServeOptions.fetch)
- [`MaligatorServeOptions.headersTimeout`](/api/runtime#MaligatorServeOptions.headersTimeout)
- [`MaligatorServeOptions.requestTimeout`](/api/runtime#MaligatorServeOptions.requestTimeout)
- [`MaligatorServeOptions.keepAliveTimeout`](/api/runtime#MaligatorServeOptions.keepAliveTimeout)
- [`MaligatorServeOptions.maxConnections`](/api/runtime#MaligatorServeOptions.maxConnections)
- [`MaligatorServer.port`](/api/runtime#MaligatorServer.port)
- [`Mal.serve`](/api/runtime#Mal.serve)

</details>

## CLI

- [`init`](/api/cli#init) — Command and flag reference.
- [`doctor`](/api/cli#doctor) — Command and flag reference.
- [`build`](/api/cli#build) — Command and flag reference.
- [`run`](/api/cli#run) — Command and flag reference.
- [`dev`](/api/cli#dev) — Command and flag reference.
- [`test`](/api/cli#test) — Command and flag reference.
- [`--profile`](/api/cli#profile) — Command and flag reference.
- [`cache`](/api/cli#cache) — Command and flag reference.
- [`Diagnostic build options`](/api/cli#diagnostic-build-options) — Command and flag reference.
- [`--compile-concurrency`](/api/cli#build) — Production total job limit, integer 1..3. Default is at most 3, bounded by host CPU capacity. Profiling is serial.
- [`--compile-concurrency`](/api/cli#test) — 1. Positive integer compilation budget.                                             

