Docs

API Reference

Builder methods, options, and outputs for Alien Daemons.

Constructor

new alien.Daemon(id: string)
ParameterTypeRequiredDescription
idstringYesDaemon 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" })
FieldTypeRequiredDescription
type"image" | "source"YesUse an existing image or build from source. Current Local and Kubernetes controllers run image-based daemons.
imagestringFor imageContainer image reference.
srcstringFor sourceSource directory. Reserved in the schema; not currently supported by the Local or Kubernetes daemon controllers.
toolchainToolchainConfigFor sourceBuild 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",
})
ParameterTypeRequiredDescription
varsRecord<string, string>YesEnvironment variable map.

Calling .environment() replaces the current daemon environment map.

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")
ParameterTypeRequiredDescription
profilestringYesPermission profile name from the stack permissions configuration.

commandsEnabled

Enables or disables the Commands protocol.

.commandsEnabled(true)
ParameterTypeDefaultDescription
enabledbooleanfalseWhen 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.

FieldTypeDescription
daemonNamestringRuntime daemon name.
runningbooleanWhether 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

On this page