Wraps a Jido.Agent module as a Node.
AgentNode carries per-instance configuration for how the agent should be spawned and communicated with. It supports three communication modes:
:sync(default) — spawn agent, send context as signal, await result:async— spawn agent, return immediately with:pendingoutcome:streaming— spawn agent, subscribe to state transitions at specified states
AgentNode delegates metadata (name, description, schema) to the wrapped agent module. Scoping of results is the responsibility of the composition layer (Machine/Strategy), not the node.
Jido.AI Agent Support
AgentNode also supports Jido.AI.Agent modules (e.g. use Jido.AI.Agent).
These are detected automatically — they export ask_sync/3 but not
run_sync/2 or query_sync/3. See Jido.Composer.Node.ai_agent_module?/1.
In sync mode, run/3 spawns a temporary AgentServer, sends the query
via ask_sync/3, and stops the process after receiving the result.
Tool spec generation adapts for AI agents: instead of exposing the agent's
internal state schema, to_tool_spec/1 returns a {"query": "string"} schema
so the agent appears as a clean tool in orchestrator contexts.