NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::a2a::CopyNinjaNode Class Referencefinal

Local GraphNode adapter for a materialized Copy Ninja harness. More...

#include <agent_card_candidate.h>

Inheritance diagram for neograph::a2a::CopyNinjaNode:
[legend]
Collaboration diagram for neograph::a2a::CopyNinjaNode:
[legend]

Public Member Functions

std::string get_name () const override
 Get the node's unique name within the graph.
 
asio::awaitable< graph::NodeOutput > run (graph::NodeInput input) override
 Unified dispatch entry for sync work, async work, and streaming.
 

Detailed Description

Local GraphNode adapter for a materialized Copy Ninja harness.

This node has no transport, credentials, or remote-agent dependency. It reads the prompt channel and overwrites the response channel with the fixed locally materialized behavior.

Definition at line 178 of file agent_card_candidate.h.

Member Function Documentation

◆ get_name()

std::string neograph::a2a::CopyNinjaNode::get_name ( ) const
overridevirtual

Get the node's unique name within the graph.

Returns
Node name string.

Implements neograph::graph::GraphNode.

◆ run()

asio::awaitable< graph::NodeOutput > neograph::a2a::CopyNinjaNode::run ( graph::NodeInput  in)
overridevirtual

Unified dispatch entry for sync work, async work, and streaming.

New nodes override THIS method. Read in.state for channel inputs, read in.ctx for available per-run metadata (cancel token, thread ID, current step, …), check in.stream_cb for an optional LLM_TOKEN sink, and return a NodeOutput (alias for NodeResult) populated with channel writes plus optional Command / Send directives.

The engine (NodeExecutor::execute_node_with_retry_async) dispatches only through this method. Sync-vs-async is no longer a public virtual cross-product: perform immediate work before co_return, or co_await asynchronous dependencies.

class MyNode : public GraphNode {
asio::awaitable<NodeOutput> run(NodeInput in) override {
auto request = make_provider_request(*provider_, model_, in.state.get_provider_messages());
auto outcome = co_await provider_->invoke_async(std::move(request));
record_usage(in.ctx, outcome);
outcome_or_throw(outcome);
NodeOutput out;
out.writes.push_back(provider_messages_write(outcome));
co_return out;
}
std::string get_name() const override { return "my_node"; }
};
std::vector< ChannelWrite > writes
Channel writes from this node.
Definition types.h:903
See also
NodeInput and NodeOutput above.

Lifetime note: in is taken by value so the coroutine frame owns its own copy of the struct. The state / ctx references inside still point to objects on the engine's suspended-frame stack (which outlive the run by construction), but the struct itself is no longer a reference parameter. The coroutine-reference-parameter UAF fixed in the v0.2.0 RunConfig path does not apply here.

Implements neograph::graph::GraphNode.


The documentation for this class was generated from the following file: