NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
command_journal.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <neograph/api.h>
15
16#include <cstdint>
17#include <memory>
18#include <optional>
19#include <string>
20#include <string_view>
21
22namespace neograph::program {
23
26 std::uint64_t sequence = 0;
27 std::string bundle_id;
28 std::uint64_t command_ordinal = 0;
29 JavaScriptCommand command = JavaScriptCommand::call_core(
30 "journal:default", "journal:default", json::object());
31 std::optional<std::string> effect_identity;
33 std::optional<json> terminal_result;
40 std::optional<json> settled_members;
49 std::optional<json> await_started_at;
50};
51
60class NEOGRAPH_PROGRAM_API ProgramJavaScriptCommandJournalEntry final {
61public:
65 static constexpr std::uint32_t STORAGE_SCHEMA_VERSION = 3;
66
69 static ProgramJavaScriptCommandJournalEntry parse(std::string_view stored_bytes);
70
71 std::uint64_t sequence() const noexcept;
72 const std::string& bundle_id() const noexcept;
73 std::uint64_t command_ordinal() const noexcept;
74 const JavaScriptCommand& command() const noexcept;
75 std::optional<std::string> effect_identity() const;
76 std::optional<json> terminal_result() const;
77 std::optional<json> settled_members() const;
78 std::optional<json> await_started_at() const;
79 bool pending() const noexcept;
80 bool completed() const noexcept;
82 const std::string& coordinate_id() const noexcept;
84 const std::string& id() const noexcept;
85 std::string serialize_canonical() const;
86
87private:
88 struct Impl;
89 explicit ProgramJavaScriptCommandJournalEntry(std::shared_ptr<const Impl> impl);
90 std::shared_ptr<const Impl> impl_;
91};
92
93} // namespace neograph::program
NEOGRAPH_API export/import macro for shared-library builds.
Immutable host-owned JavaScript command.
Definition command.h:62
Immutable, content-addressed command-journal value.
Closed, versioned command values emitted by JavaScript control code.
Immutable outcome of one Program run attempt.
One append-only journal entry for one yielded JavaScript command.
std::optional< json > terminal_result
Null for a durable pending head; present for an authoritative result.
std::optional< json > settled_members
Pending entries only: the members of a paused join that already settled, as an object from member ope...
std::optional< json > await_started_at
Pending entries only (#391): when each ng.await with a timeout in this command started,...