Expand description
Self-tool dispatch.
The agentic loop’s tools come from connected MCP servers plus agentd’s own
self-tools (subagent.spawn, …). A SelfHandler supplies those tool
definitions and handles their calls in-process — distinct from the MCP
dispatch path. This is the seam through which the model self-orchestrates:
it calls subagent.spawn to split its instruction into delegated child
agents. The model only asks; the supervisor is what enforces the depth and
concurrency caps and narrows the child’s scope, so a compromised model
cannot widen its own budget through this seam.
Enums§
- Tool
Class - The classes of tool the agentic loop offers the model. This boundary is what keeps two invariants true: a task tool reaches the model ONLY by being exported from a registered MCP server or registered in code by the embedder, and nothing in the catalogue shells out to a local command. EVERY tool the loop advertises is exactly one of these classes; there is no third “general capability library” that could smuggle in an unaudited capability.
Constants§
- SELF_
CONTROL_ TOOLS - The authoritative membership of the
ToolClass::SelfControlclass: every self/control primitive name agentd may offer the model. TheSelfHandleradvertises a depth-/feature-conditioned SUBSET of this set (a2a.delegateonly with peers;schedule/subscribe/unsubscribeonly at the root; thesubagent.*delegation tools only within the depth budget), and the runner addsresource.readwhen any resource is readable. A test asserts that everything a handler can advertise appears in this list, so a new self-tool cannot silently escape the class boundary. By construction the set contains no local-execution primitive.
Traits§
- Self
Handler - Provides agentd’s in-process self-tools to the loop. The loop tries the
self-handler first; a
Noneresult means “not a self-tool — fall through to MCP”.