API Reference
Builder methods, options, and outputs for Alien Daemons.
Constructor
new alien.Daemon(id: string)| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Daemon resource ID. Must contain only letters, numbers, hyphens, and underscores, up to 64 characters. |
code
Sets what the daemon runs.
.code({ type: "image", image: "ghcr.io/acme/connector:v1" })| Field | Type | Required | Description |
|---|---|---|---|
type | "image" | "source" | Yes | Use an existing image or build from source. Current Local and Kubernetes controllers run image-based daemons. |
image | string | For image | Container image reference. |
src | string | For source | Source directory. Reserved in the schema; not currently supported by the Local or Kubernetes daemon controllers. |
toolchain | ToolchainConfig | For source | Build toolchain. |
Daemon source fields exist in the schema, but alien build does not currently build daemon source into an image. Use image for Daemon today.
environment
Sets environment variables.
.environment({
LOG_LEVEL: "info",
ENDPOINT: "https://example.com",
})| Parameter | Type | Required | Description |
|---|---|---|---|
vars | Record<string, string> | Yes | Environment variable map. |
Calling .environment() replaces the current daemon environment map.
link
Links another resource to the daemon.
const vault = new alien.Vault("credentials").build()
const daemon = new alien.Daemon("connector")
.code({ type: "image", image: "ghcr.io/acme/connector:v1" })
.link(vault)
.permissions("execution")
.build()Linked resources are passed to the daemon through the same environment variables used by Workers and Containers.
permissions
Assigns the daemon permission profile.
.permissions("execution")| Parameter | Type | Required | Description |
|---|---|---|---|
profile | string | Yes | Permission profile name from the stack permissions configuration. |
commandsEnabled
Enables or disables the Commands protocol.
.commandsEnabled(true)| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | When enabled, the daemon runtime polls the manager for pending commands and dispatches registered handlers. |
build
const daemon = new alien.Daemon("connector")
.code({ type: "image", image: "ghcr.io/acme/connector:v1" })
.permissions("execution")
.build()build() validates the daemon configuration and returns a Resource with type "daemon".
Outputs
Daemon outputs are available in stack state after provisioning.
| Field | Type | Description |
|---|---|---|
daemonName | string | Runtime daemon name. |
running | boolean | Whether the daemon is running according to the controller. |
Unsupported Surface
Daemons do not expose builder methods for:
- ingress or public URLs
- triggers
- direct invocation
- request timeout
- memory or CPU sizing
- replica count or autoscaling
- persistent storage