ReqManagedAgents.Provisioner.Runtime (ReqManagedAgents v0.10.0)

Copy Markdown View Source

A language runtime to install in a provisioned environment. new/1 is the single shape+charset validation gate (the version charset closes shell injection through the rendered bootstrap script).

Summary

Types

t()

@type t() :: %ReqManagedAgents.Provisioner.Runtime{
  lang: atom(),
  version: String.t(),
  via: :mise
}

Functions

new(r)

@spec new(t() | map()) :: {:ok, t()} | {:error, {:invalid_runtime, term()}}

Builds and validates a ReqManagedAgents.Provisioner.Runtime.

Accepts a map with :lang (atom) and :version (binary) keys, plus an optional :via (defaults to :mise; only :mise is currently supported). Also accepts an existing ReqManagedAgents.Provisioner.Runtime struct, which is re-validated (so a struct built by other means still passes through the charset gate before it can reach rendering).

Returns {:ok, t()} or {:error, {:invalid_runtime, term()}}.