Compile-time installer and resolver for Spectre packages.
A Stack describes one immutable environment. Packages contribute manifests, local DSL compilers, optional tool descriptors and caller-owned resources. Secrets and live clients belong in runtime configuration, not this definition.
defmodule MyApp.AI do
use Spectre.Stack
install MyApp.Inference do
provider :openrouter, MyApp.OpenRouter
model :fast, id: "small-model"
end
endSelecting stack: MyApp.AI in Spectre.Agent connects package-declared Agent
extensions. Selecting tools: MyApp.AI in Spectre.Server generates private
helpers from installed Spectre.Stack.Installable.tools/1 descriptors.
Packages do not need to export those helper functions themselves.
Helpers append commands; runtime adapters resolve named Stack resources,
return cognitive results or normalize bound consequences to GAM proposals.
Installation and bind: configuration do not grant authority. Governed
operations need authenticated host scope, contracts, mandate and executors.
See the Stack Tools and GAM guides.
Spectre.Stack.Runtime supervises declared resources when explicitly started
by the host. Pass its stable name as stack_runtime: to resource-using Servers.
Standalone package APIs and older Instance/Run integrations remain separate
compatibility paths.
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.