SkillKit.AgentRef (SkillKit v0.4.0)

Copy Markdown View Source

Opaque reference to a running agent.

Returned by SkillKit.start_agent/2. Used with SkillKit.send_message/2 and SkillKit.stop_agent/1.

Summary

Functions

Builds an AgentRef from an %Agent{} struct (registry already set).

Classifies an agent name relative to a root agent name.

Types

origin()

@type origin() :: :root | :skill | :delivery | :subloop | :other

t()

@type t() :: %SkillKit.AgentRef{
  name: String.t(),
  registry: atom(),
  supervisor_pid: pid() | nil
}

Functions

from_agent(agent)

@spec from_agent(SkillKit.Agent.t()) :: t()

Builds an AgentRef from an %Agent{} struct (registry already set).

origin(name, root)

@spec origin(String.t(), String.t()) :: origin()

Classifies an agent name relative to a root agent name.

Sub-loops are named "<root>/<kind>:<id>" (e.g. "neve/skill:plan", "neve/delivery:abc"), so the prefix reveals where the name came from:

  • :root — the top-level conversation
  • :skill — an activate_skill sub-loop
  • :delivery — a webhook delivery sub-loop
  • :subloop — any other descendant sub-loop
  • :other — an unrelated agent