pub struct AgentProtocolHarness { /* private fields */ }Expand description
Release-bound, multi-session kernel used by the sole native Harness.
Each entry is an AgentProtocolHost over one ordinary AgentSession.
The map only retains those Code-owned sessions for conversation reuse; it
never mirrors their runs or events. Miss admission is serialized so two
concurrent commands cannot construct the same session twice, while work on
already admitted sessions remains concurrent.
Implementations§
Source§impl AgentProtocolHarness
impl AgentProtocolHarness
Sourcepub fn new(
manifest: AgentReleaseManifest,
agent: Arc<Agent>,
workspace: impl Into<String>,
) -> Result<Self, AgentProtocolHarnessError>
pub fn new( manifest: AgentReleaseManifest, agent: Arc<Agent>, workspace: impl Into<String>, ) -> Result<Self, AgentProtocolHarnessError>
Admit one release into the native Harness compatibility surface.
Sourcepub fn with_session_options(self, options: SessionOptions) -> Self
pub fn with_session_options(self, options: SessionOptions) -> Self
Apply common options to every Code session created by this Harness.
A caller-provided session ID is ignored. The exact protocol identity is authoritative, and auto-save is always enabled when a store is present.
Sourcepub fn with_max_sessions(
self,
max_sessions: usize,
) -> Result<Self, AgentProtocolHarnessError>
pub fn with_max_sessions( self, max_sessions: usize, ) -> Result<Self, AgentProtocolHarnessError>
Override the finite retained-session limit.
pub fn manifest(&self) -> &AgentReleaseManifest
pub fn agent_release_identity(&self) -> &str
pub fn max_sessions(&self) -> usize
pub fn is_closed(&self) -> bool
pub async fn session_count(&self) -> usize
Sourcepub async fn execute(
&self,
command: &AgentProtocolCommandV1,
) -> Result<AgentProtocolCommandReceiptV1, AgentProtocolHarnessError>
pub async fn execute( &self, command: &AgentProtocolCommandV1, ) -> Result<AgentProtocolCommandReceiptV1, AgentProtocolHarnessError>
Route an exact command into its Code-owned conversation session.
Sourcepub async fn event_page(
&self,
request: &AgentProtocolEventPageRequestV1,
) -> Result<AgentProtocolEventPageV1, AgentProtocolHarnessError>
pub async fn event_page( &self, request: &AgentProtocolEventPageRequestV1, ) -> Result<AgentProtocolEventPageV1, AgentProtocolHarnessError>
Route a bounded event query into the same authoritative Code session.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentProtocolHarness
impl !RefUnwindSafe for AgentProtocolHarness
impl !UnwindSafe for AgentProtocolHarness
impl Send for AgentProtocolHarness
impl Sync for AgentProtocolHarness
impl Unpin for AgentProtocolHarness
impl UnsafeUnpin for AgentProtocolHarness
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more