yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
agent_chat_history_codec.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_CODEC_H_
2#define YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_CODEC_H_
3
4#include <filesystem>
5#include <optional>
6#include <string>
7#include <vector>
8
9#include "absl/status/status.h"
10#include "absl/status/statusor.h"
11#include "absl/time/time.h"
13
14namespace yaze {
15namespace editor {
16
17// Bridges chat history persistence to optional JSON support. When the
18// application is built without gRPC/JSON support these helpers gracefully
19// degrade and report an Unimplemented status so the UI can disable
20// persistence instead of failing to compile.
22 public:
24 bool active = false;
25 std::string session_id;
26 std::string session_name;
27 std::vector<std::string> participants;
28 absl::Time last_synced = absl::InfinitePast();
29 };
30
32 std::optional<std::filesystem::path> last_capture_path;
33 std::string status_message;
34 absl::Time last_updated = absl::InfinitePast();
35 };
36
37 struct Snapshot {
38 std::vector<cli::agent::ChatMessage> history;
41 };
42
43 // Returns true when the codec can actually serialize / deserialize history.
44 static bool Available();
45
46 static absl::StatusOr<Snapshot> Load(const std::filesystem::path& path);
47 static absl::Status Save(const std::filesystem::path& path,
48 const Snapshot& snapshot);
49};
50
51} // namespace editor
52} // namespace yaze
53
54#endif // YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_CODEC_H_
static absl::Status Save(const std::filesystem::path &path, const Snapshot &snapshot)
static absl::StatusOr< Snapshot > Load(const std::filesystem::path &path)
Main namespace for the application.
std::optional< std::filesystem::path > last_capture_path
std::vector< cli::agent::ChatMessage > history