EveClient
NexusLabs.Eve¶
EveClient Class¶
Calls the stable HTTP routes exposed by one deployed eve agent.
Inheritance System.Object → EveClient
Constructors¶
EveClient(HttpMessageInvoker, EveClientOptions) Constructor¶
Initializes a client with a caller-owned HTTP transport.
public EveClient(System.Net.Http.HttpMessageInvoker transport, NexusLabs.Eve.EveClientOptions options);
Parameters¶
transport System.Net.Http.HttpMessageInvoker
The transport used for all requests. The caller retains ownership and must keep it alive while sessions or response streams are active.
options EveClientOptions
The host, authentication, headers, and retry options.
Methods¶
EveClient.AttachSession(string, int) Method¶
Creates a session handle for a known immutable session identifier.
Parameters¶
sessionId System.String
The runtime-owned session identifier to attach to.
streamIndex System.Int32
The absolute number of stream events already consumed.
Returns¶
EveSession
A fixed handle addressing the supplied session.
EveClient.CreateSession() Method¶
Creates a handle for a fresh conversation.
Returns¶
EveSession
A session whose first send creates the remote run.
EveClient.CreateSession(EveSessionCreationOptions) Method¶
Creates a fresh handle with fixed declarative creation-time tool stubs.
Parameters¶
options EveSessionCreationOptions
Creation settings; turn headers are supplied on the first send.
Returns¶
EveSession
A session whose initial message sends the stub declarations.
Exceptions¶
System.ArgumentNullException
The options are null.
System.ArgumentException
Stub identifiers are duplicated or the rule limit is exceeded.
EveClient.CreateSession(EveSessionState) Method¶
Creates a handle from a previously persisted session cursor.
Parameters¶
state EveSessionState
The session state to resume.
Returns¶
EveSession
A session initialized from the supplied cursor.
EveClient.GetHealthAsync(CancellationToken) Method¶
Checks whether the eve deployment is ready.
public System.Threading.Tasks.Task<NexusLabs.Eve.EveHealthStatus> GetHealthAsync(System.Threading.CancellationToken cancellationToken);
Parameters¶
cancellationToken System.Threading.CancellationToken
Cancels the request.
Returns¶
System.Threading.Tasks.Task<EveHealthStatus>
The validated health payload.
Exceptions¶
EveClientException
The server returned a non-successful status.
EveHealthResponseException
The successful response did not match the health contract.
EveClient.GetInfoAsync(CancellationToken) Method¶
Fetches and validates the agent inspection payload.
public System.Threading.Tasks.Task<NexusLabs.Eve.EveAgentInfo> GetInfoAsync(System.Threading.CancellationToken cancellationToken);
Parameters¶
cancellationToken System.Threading.CancellationToken
Cancels the request.
Returns¶
System.Threading.Tasks.Task<EveAgentInfo>
Validated identity fields and the complete raw agent-info document.
Exceptions¶
EveClientException
The server returned a non-successful status.
EveProtocolException
The body was not a recognized agent-info payload.
EveClient.PrewarmSessionAsync(EveSessionCreationOptions, CancellationToken) Method¶
Creates an idle remote session with fixed declarative tool stubs.
public System.Threading.Tasks.Task<NexusLabs.Eve.EveSession> PrewarmSessionAsync(NexusLabs.Eve.EveSessionCreationOptions? options, System.Threading.CancellationToken cancellationToken);
Parameters¶
options EveSessionCreationOptions
Optional stubs and creation request headers.
cancellationToken System.Threading.CancellationToken
Cancels remote creation.
Returns¶
System.Threading.Tasks.Task<EveSession>
The accepted fixed session handle.
Exceptions¶
EveClientException
The server rejects creation, including missing stub permission.
EveProtocolException
The accepted response is malformed.
System.ArgumentException
Stub identifiers are duplicated or the rule limit is exceeded.
System.OperationCanceledException
Creation was cancelled.
EveClient.PrewarmSessionAsync(CancellationToken) Method¶
Creates a remote conversation before its first user message.
public System.Threading.Tasks.Task<NexusLabs.Eve.EveSession> PrewarmSessionAsync(System.Threading.CancellationToken cancellationToken);
Parameters¶
cancellationToken System.Threading.CancellationToken
Cancels remote session creation.
Returns¶
System.Threading.Tasks.Task<EveSession>
A session accepted by the remote eve deployment.
Exceptions¶
EveClientException
The eve session route returned a non-successful response.
EveProtocolException
The eve session route returned malformed JSON or omitted its session identifier.
System.OperationCanceledException
Remote session creation was cancelled.
Remarks¶
This method performs network I/O and requires eve 0.59.0 or newer.
The returned session has a fixed remote identifier and a zero stream cursor.
Its first SendAsync(string, CancellationToken) uses the
existing-session route.
EveClient.SendRawAsync(HttpRequestMessage, EveRawRequestOptions, CancellationToken) Method¶
Sends a caller-owned request against a relative path on this eve target. Client headers and authentication are applied before sending.
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendRawAsync(System.Net.Http.HttpRequestMessage request, NexusLabs.Eve.EveRawRequestOptions? options, System.Threading.CancellationToken cancellationToken);
Parameters¶
request System.Net.Http.HttpRequestMessage
The request to send. Its URI must be relative. The request remains owned by the caller.
options EveRawRequestOptions
Optional explicit protected-header overrides.
cancellationToken System.Threading.CancellationToken
Cancels the request.
Returns¶
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
The raw response. The caller must dispose it. Non-successful statuses are returned unchanged.
EveClient.SendRawAsync(HttpRequestMessage, CancellationToken) Method¶
Sends a caller-owned request against a relative path on this eve target. Client headers and authentication are applied before sending.
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendRawAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken);
Parameters¶
request System.Net.Http.HttpRequestMessage
The request to send. Its URI must be relative. The request remains owned by the caller.
cancellationToken System.Threading.CancellationToken
Cancels the request.
Returns¶
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
The raw response. The caller must dispose it. Non-successful statuses are returned unchanged.