Compile-time installer and resolver for Spectre packages.
A Stack describes one immutable environment. Packages contribute manifests, local DSL compilers, and optional caller-owned runtime resources without importing package verbs globally or registering capabilities in a process registry.
defmodule MyApp.AI do
use Spectre.Stack
install MyApp.Inference do
provider :openrouter, MyApp.OpenRouter
model :fast, id: "small-model"
end
endSelecting the Stack from use Spectre.Agent, stack: MyStack activates every
package-declared Agent extension. Installed operations and planner-visible
actions still require explicit Flow, Work, Skill, or policy binding before
they are visible or authorized.
Summary
Functions
Initializes a Stack definition.
Returns immutable configuration for a package bound to an Agent.
Returns the immutable definition for a Stack module.
Installs and compiles one package.
Installs a package with explicit options and a package-local DSL block.
Returns the immutable installation selected through an Agent's Stack.
Resolves a logical capability from a Stack module.
Starts a caller-owned runtime for a Stack.
Functions
Initializes a Stack definition.
Returns immutable configuration for a package bound to an Agent.
@spec definition(module()) :: Spectre.Stack.Definition.t()
Returns the immutable definition for a Stack module.
Installs and compiles one package.
Installs a package with explicit options and a package-local DSL block.
@spec installation(module(), term()) :: {:ok, Spectre.Stack.Installation.t()} | {:error, term()}
Returns the immutable installation selected through an Agent's Stack.
@spec resolve(module(), Spectre.Stack.Definition.capability_kind(), term()) :: {:ok, Spectre.Stack.Ref.t()} | {:error, term()}
Resolves a logical capability from a Stack module.
@spec start_link( module(), keyword() ) :: Supervisor.on_start()
Starts a caller-owned runtime for a Stack.