Normandy.Behaviours.AgentTemplate behaviour (normandy v1.0.0)

View Source

Resolves the node-local, non-serializable half of an agent's config from a stable template_id: the tool registry, before/after hooks, and a client_builder that turns a credential token into an LLM client struct.

The host registers a supplement per template_id on every node at boot (same code → same supplement). Combined with the persisted non-secret template (SessionStore.{save,load}_config_template) and the node-local CredentialProvider, this reconstructs a full %BaseAgentConfig{} on any node without moving secrets or closures across the cluster.

Summary

Types

supplement()

@type supplement() :: %{
  tool_registry: term(),
  before_hooks: [term()],
  after_hooks: [term()],
  client_builder: (String.t() -> struct())
}

Callbacks

fetch(handle, template_id)

@callback fetch(handle :: term(), template_id :: String.t()) ::
  {:ok, supplement()} | :error