12#include <unordered_map>
66 return broker_ !=
nullptr;
78 std::size_t maximum_bytes);
84 bool disconnect_client_on_close)
85 : service_(&service), broker_(accepted ? &service.broker_ : nullptr),
87 progress_sink_(
std::move(progress_sink)),
88 disconnect_client_on_close_(disconnect_client_on_close) {}
90 void close() noexcept;
97 bool disconnect_client_on_close_ = true;
98 std::optional<
std::vector<
std::
string>> negotiated_features_;
104 bool disconnect_client_on_close =
true);
111 struct CompletionOwner {
117 std::unordered_map<std::string, std::function<void(
ControlBroker&)>> deferred_operations;
120 ControlServiceResult
dispatch(
Session& session, std::string_view encoded_envelope);
121 ControlServiceResult dispatch_request(
Session& session,
const ControlRequestEnvelope& request);
123 std::uint64_t offset, std::size_t maximum_bytes);
125 ControlBroker& broker_;
127 ControlServiceConfig config_;
128 std::shared_ptr<CompletionOwner> completion_owner_;
Dormant composition root for the local capability-control broker.
Definition control_broker.hpp:45
Carrier-owned state for exactly one authenticated local connection.
Definition control_service.hpp:57
Session(Session &&other) noexcept
const VerifiedControlPeerIdentity & peer() const
Definition control_service.hpp:71
ControlServiceResult dispatch(std::string_view encoded_envelope)
Session & operator=(const Session &)=delete
bool is_open() const
Definition control_service.hpp:65
Session(const Session &)=delete
ControlArtifactReadResult read_artifact(std::string_view artifact_id, std::uint64_t offset, std::size_t maximum_bytes)
Reads only artifacts produced by this connection-bound client ID.
Session & operator=(Session &&other) noexcept
friend class ControlService
Definition control_service.hpp:81
const ControlClientId & client_id() const
Definition control_service.hpp:68
Session open_session(const VerifiedControlPeerIdentity &peer, const ControlClientId &connection_client_id, ProgressSink progress_sink={}, bool disconnect_client_on_close=true)
std::function< bool(const ControlProgressEnvelope &)> ProgressSink
Definition control_service.hpp:47
ControlService(ControlBroker &broker, Executor executor={}, ControlServiceConfig config={})
bool is_listening() const
Definition control_service.hpp:106
ControlOperationExecutor Executor
Definition control_service.hpp:48
ControlProgressReporter ProgressReporter
Definition control_service.hpp:46
Copyable proof minted only by the broker's trusted OS peer verifier.
Definition control_identity.hpp:63
Definition agent_context.hpp:7
ControlServiceStatus
Definition control_service.hpp:16
@ ReceiptTransitionFailed
Definition control_service.hpp:21
@ InvalidEnvelope
Definition control_service.hpp:18
@ NegotiationRequired
Definition control_service.hpp:22
@ UnsupportedMessage
Definition control_service.hpp:19
@ Responded
Definition control_service.hpp:17
@ AdmissionDenied
Definition control_service.hpp:20
std::function< bool(std::uint64_t current, std::uint64_t total, std::string detail_json)> ControlProgressReporter
Definition control_execution.hpp:23
std::string_view control_service_status_id(ControlServiceStatus status)
@ ResourceExhausted
Definition control_admission.hpp:26
std::function< ControlExecutionOutcome( const ControlAdmissionPlan &, const ControlRequestEnvelope &, const ControlExecutionContext &)> ControlOperationExecutor
Trusted in-process adapter contract.
Definition control_execution.hpp:56
Definition control_artifacts.hpp:146
Definition control_identity.hpp:28
A bounded progress observation for one admitted operation.
Definition control_protocol.hpp:109
Definition control_service.hpp:35
std::size_t maximum_progress_events_per_operation
Definition control_service.hpp:36
Definition control_service.hpp:28
std::string explanation
Definition control_service.hpp:32
std::optional< ControlAdmissionStatus > admission_status
Definition control_service.hpp:31
std::optional< ControlEnvelope > response
Definition control_service.hpp:30
ControlServiceStatus status
Definition control_service.hpp:29