Runtime
The @antelopejs/interface-core/runtime module exposes information about the environment a project runs in, along with a registry for development servers. The AntelopeJS core provides the implementation: ajs project dev reports development mode, while ajs project start and ajs project run report production mode.
import {
GetRuntimeInfo,
RegisterDevServer,
DEV_REGISTRY_PATH,
} from "@antelopejs/interface-core/runtime";
GetRuntimeInfo
GetRuntimeInfo retrieves information about the runtime environment of the running project. Use it when a module needs to behave differently in development — for example, enabling verbose diagnostics or relaxing security checks.
const info = await GetRuntimeInfo();
// { dev: true, projectPath: "/path/to/project", env: "default" }
| Field | Description |
|---|---|
dev | true when running under ajs project dev, false otherwise. |
projectPath | Absolute path to the root of the running project. |
env | Name of the active configuration environment. |
RegisterDevServer
RegisterDevServer registers a development server and the endpoints it listens on. Modules that bind network ports (such as an HTTP API) call it after a successful listen(), so external tooling can discover the actual endpoints.
await RegisterDevServer("api", [
{ protocol: "http", host: "localhost", port: 5011 },
]);
In development mode, the core merges the registration into the dev registry file and removes the file on shutdown. Outside development mode, the call is a no-op, so modules can call it unconditionally.
Dev Registry File
The dev registry file lives at DEV_REGISTRY_PATH (.antelope/dev.json) relative to the project root. The DevServerRegistry type describes its shape, and DevServerEndpoint describes each endpoint entry.
{
"pid": 12345,
"startedAt": "2026-06-12T10:00:00Z",
"servers": {
"api": {
"endpoints": [{ "protocol": "http", "host": "localhost", "port": 5011 }]
}
}
}
pid exists. If that process is gone, the file is orphaned and must be ignored or overwritten.See also
- Configuration — Environments and module sources referenced by the runtime info
- Core Utilities — Other functions exported by the core interface