Simplified WebSocket client for z3ed CLI. More...
#include <z3ed_network_client.h>
Classes | |
class | Impl |
Public Member Functions | |
Z3edNetworkClient () | |
~Z3edNetworkClient () | |
absl::Status | Connect (const std::string &host, int port=8765) |
absl::Status | JoinSession (const std::string &session_code, const std::string &username) |
absl::Status | SubmitProposal (const std::string &description, const std::string &proposal_json, const std::string &username) |
absl::StatusOr< std::string > | GetProposalStatus (const std::string &proposal_id) |
absl::StatusOr< bool > | WaitForApproval (const std::string &proposal_id, int timeout_seconds=60) |
absl::Status | SendMessage (const std::string &message, const std::string &sender) |
absl::StatusOr< std::string > | QueryAI (const std::string &query, const std::string &username) |
void | Disconnect () |
bool | IsConnected () const |
Private Attributes | |
std::unique_ptr< Impl > | impl_ |
Simplified WebSocket client for z3ed CLI.
Provides command-line friendly interface for:
Definition at line 28 of file z3ed_network_client.h.
yaze::cli::net::Z3edNetworkClient::Z3edNetworkClient | ( | ) |
Definition at line 335 of file z3ed_network_client.cc.
|
default |
absl::Status yaze::cli::net::Z3edNetworkClient::Connect | ( | const std::string & | host, |
int | port = 8765 |
||
) |
absl::Status yaze::cli::net::Z3edNetworkClient::JoinSession | ( | const std::string & | session_code, |
const std::string & | username | ||
) |
absl::Status yaze::cli::net::Z3edNetworkClient::SubmitProposal | ( | const std::string & | description, |
const std::string & | proposal_json, | ||
const std::string & | username | ||
) |
Submit proposal
description | Human-readable description |
proposal_json | JSON string with proposal details |
Definition at line 351 of file z3ed_network_client.cc.
References impl_.
absl::StatusOr< std::string > yaze::cli::net::Z3edNetworkClient::GetProposalStatus | ( | const std::string & | proposal_id | ) |
absl::StatusOr< bool > yaze::cli::net::Z3edNetworkClient::WaitForApproval | ( | const std::string & | proposal_id, |
int | timeout_seconds = 60 |
||
) |
Wait for proposal approval (blocking)
timeout_seconds | How long to wait |
Definition at line 363 of file z3ed_network_client.cc.
References impl_.
absl::Status yaze::cli::net::Z3edNetworkClient::SendMessage | ( | const std::string & | message, |
const std::string & | sender | ||
) |
absl::StatusOr< std::string > yaze::cli::net::Z3edNetworkClient::QueryAI | ( | const std::string & | query, |
const std::string & | username | ||
) |
Query AI agent (if enabled)
Definition at line 375 of file z3ed_network_client.cc.
References impl_.
void yaze::cli::net::Z3edNetworkClient::Disconnect | ( | ) |
bool yaze::cli::net::Z3edNetworkClient::IsConnected | ( | ) | const |
|
private |
Definition at line 95 of file z3ed_network_client.h.
Referenced by Connect(), Disconnect(), GetProposalStatus(), IsConnected(), JoinSession(), QueryAI(), SendMessage(), SubmitProposal(), and WaitForApproval().