NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
agent_card_candidate.h
Go to the documentation of this file.
1
17#pragma once
18
19#include <neograph/a2a/types.h>
20#include <neograph/api.h>
21#include <neograph/graph/node.h>
22
23#include <cstddef>
24#include <memory>
25#include <string>
26#include <string_view>
27#include <vector>
28
29namespace neograph::a2a {
30
32struct NEOGRAPH_API AgentCardSourceProvenance {
34 std::string discovery_url;
36 std::string source_url;
38 std::string source_revision;
40 std::string source_license;
41};
42
44struct NEOGRAPH_API AgentCardCollectionPolicy {
46 std::size_t max_card_bytes = 64 * 1024;
48 bool allow_loopback_http = false;
49};
50
52struct NEOGRAPH_API CollectedAgentCard {
53 AgentCard card;
55 std::string card_sha256;
56 json raw_card;
57};
58
66class NEOGRAPH_API AgentCardCollector {
67public:
69
70 CollectedAgentCard collect(std::string discovery_url,
71 AgentCardSourceProvenance provenance) const;
72
73private:
75};
76
78
91public:
96
97 [[nodiscard]] const std::string& id() const noexcept { return id_; }
98 [[nodiscard]] const std::string& source_card_sha256() const noexcept {
99 return source_card_sha256_;
100 }
101 [[nodiscard]] const json& descriptor() const noexcept { return descriptor_; }
102
103private:
104 friend class AgentCardCandidateCompiler;
105
106 AgentCardCompatibilityCandidate(std::string id,
107 std::string source_card_sha256,
108 json descriptor);
109
110 std::string id_;
111 std::string source_card_sha256_;
112 json descriptor_;
113};
114
116class NEOGRAPH_API AgentCardCandidateCompiler {
117public:
118 static AgentCardCompatibilityCandidate compile(const CollectedAgentCard& collected);
119};
120
122struct NEOGRAPH_API CopyNinjaBehavioralProbe {
123 std::string input;
124 std::string expected_output;
125};
126
133struct NEOGRAPH_API CopyNinjaBehavioralProfile {
134 std::string source_card_sha256;
135 std::string template_id;
136 std::vector<CopyNinjaBehavioralProbe> development_probes;
137};
138
139class CopyNinjaHarness;
140NEOGRAPH_API CopyNinjaHarness materialize_copy_ninja(
142
150class NEOGRAPH_API CopyNinjaHarness {
151public:
152 const AgentCardCompatibilityCandidate& candidate() const noexcept;
153 const CopyNinjaBehavioralProfile& profile() const noexcept;
154
156 std::string respond(std::string_view input) const;
157
159 AgentCard agent_card(std::string endpoint) const;
160
161private:
162 friend CopyNinjaHarness materialize_copy_ninja(const AgentCardCompatibilityCandidate& candidate,
164
166
169};
170
178class NEOGRAPH_API CopyNinjaNode final : public graph::GraphNode {
179public:
180 CopyNinjaNode(std::string name, std::shared_ptr<const CopyNinjaHarness> harness);
181 asio::awaitable<graph::NodeOutput> run(graph::NodeInput input) override;
182
183 std::string get_name() const override;
184
185private:
186 std::string name_;
187 std::shared_ptr<const CopyNinjaHarness> harness_;
188};
189
190} // namespace neograph::a2a
Core data types for the Agent-to-Agent (A2A) protocol.
NEOGRAPH_API export/import macro for shared-library builds.
Compiles a collected card into an unadmitted, text-only compatibility candidate.
Fetches one explicit A2A well-known card.
Non-executable compatibility candidate compiled from one collection record.
A local, separately materialized deterministic compatibility harness.
AgentCard agent_card(std::string endpoint) const
Build a fresh, non-impersonating A2A card for a caller-owned endpoint.
std::string respond(std::string_view input) const
Execute only the fixed, local template admitted by materialization.
Local GraphNode adapter for a materialized Copy Ninja harness.
asio::awaitable< graph::NodeOutput > run(graph::NodeInput input) override
Unified dispatch entry for sync work, async work, and streaming.
std::string get_name() const override
Get the node's unique name within the graph.
Abstract base class for all graph nodes.
Definition node.h:96
Graph node implementations: base class and built-in node types.
Collection limits for the deliberately narrow proof of concept.
Provenance declared by the operator for one open-source Agent Card.
std::string discovery_url
Exact origin fetched through the A2A well-known discovery path.
std::string source_revision
Immutable source revision, such as a Git commit SHA.
std::string source_url
Immutable source location reviewed by the operator; it is never fetched here.
std::string source_license
SPDX-style source license declaration, such as "Apache-2.0".
Subset of AgentCard required to interact (spec §5.5).
Definition types.h:222
One card record with an immutable content identity and reviewed provenance.
One independently observed development probe for a deterministic PoC template.
Behavioral evidence that is deliberately separate from an Agent Card.
Per-call input bundle for the unified run() virtual.
Definition node.h:56