Planck.Agent.Hooks (Planck.Agent v0.3.0)

Copy Markdown View Source

Hook configuration for a running agent.

Holds the four resolved hook module atoms and the sidecar node used for RPC dispatch. All fields are set once in init/1 and only read afterwards.

The dispatch wrappers (Planck.Agent.Hooks.Compactor, .Persistence, .Prompt, .TurnEnd) take this struct (or its individual fields) instead of the full agent state.

Summary

Types

t()

Hooks information.

Functions

Return after_prompt/1 injection text, or nil.

Return before_prompt/1 injection text, or nil.

Build a Hooks struct from agent start opts.

Types

t()

@type t() :: %Planck.Agent.Hooks{
  compactor: module(),
  persistence: module() | nil,
  prompt: module() | nil,
  sidecar_node: atom() | nil,
  turn_end: module() | nil
}

Hooks information.

Functions

after_prompt(hooks, session_id)

@spec after_prompt(t(), String.t() | nil) :: String.t() | nil

Return after_prompt/1 injection text, or nil.

before_prompt(hooks, session_id)

@spec before_prompt(t(), String.t() | nil) :: String.t() | nil

Return before_prompt/1 injection text, or nil.

build(opts)

@spec build(keyword()) :: t()

Build a Hooks struct from agent start opts.