Skip to main content

CodingAgentService

Struct CodingAgentService 

Source
pub struct CodingAgentService { /* private fields */ }
Expand description

One mode-neutral application service over the canonical runtime/session model.

Implementations§

Source§

impl CodingAgentService

Source

pub const fn workspace(&self) -> &WorkspaceRoot

Returns the validated workspace capability.

Source

pub const fn workspace_id(&self) -> &WorkspaceId

Returns the safe canonical workspace identity.

Source

pub const fn resources(&self) -> &ResourceCatalog

Returns the immutable resource catalog.

Source

pub const fn settings(&self) -> &CodingSettings

Returns the resolved secret-free product settings snapshot.

Source

pub fn models(&self) -> Vec<ModelRef>

Returns advertised provider models.

Source

pub fn model_capabilities( &self, model_ref: &ModelRef, ) -> Option<ModelCapabilities>

Returns capabilities for one model in the frozen provider catalog.

Source

pub fn model_spec(&self, model_ref: &ModelRef) -> Option<&ModelSpec>

Returns one advertised model contract from the frozen catalog.

Source

pub fn mcp_snapshot(&self) -> Result<McpServiceSnapshot, McpError>

Returns a safe immutable MCP lifecycle and catalog projection.

The projection excludes server-provided descriptions, annotations, process details, environment values, stderr, and result bodies.

Source

pub async fn reconnect_mcp( &self, server_id: &McpServerId, ) -> Result<McpServerHealth, McpError>

Reconnects one configured MCP server only when its new discovery snapshot exactly matches the frozen runtime catalog.

A descriptor or stale-catalog error requires rebuilding this service; reconnect never mutates its live tool registry or profile binding.

Source

pub fn subscribe( &self, session_id: SessionId, ) -> Result<Receiver<EventEnvelope>, CodingError>

Subscribes before prompt submission to avoid missing early events.

§Errors

Returns an error when the bounded subscriber registry is full.

Source

pub async fn create_session(&self) -> Result<SessionId, CodingError>

Creates a durable coding session.

§Errors

Returns a runtime or canonical command error.

Source

pub async fn open_session( &self, session_id: SessionId, ) -> Result<RuntimeSessionState, CodingError>

Attaches an existing durable session.

Source

pub async fn list_sessions( &self, ) -> Result<Vec<SessionCatalogEntry>, CodingError>

Lists durable sessions.

Source

pub async fn name_session( &self, session_id: SessionId, name: Option<SessionName>, ) -> Result<(), CodingError>

Sets a durable display name.

Source

pub async fn snapshot( &self, session_id: SessionId, ) -> Result<RuntimeSessionState, CodingError>

Returns a compact mode-neutral state projection.

Source

pub async fn session_snapshot( &self, session_id: SessionId, ) -> Result<SessionSnapshot, CodingError>

Returns the complete immutable canonical session snapshot.

Hosts use this after startup, reconnect, or an observed sequence gap to rebuild projections instead of treating transient deltas as durable.

Source

pub async fn stats( &self, session_id: SessionId, ) -> Result<SessionStats, CodingError>

Returns rebuildable session statistics.

Source

pub fn prompt( &self, session_id: SessionId, text: impl Into<String>, ) -> Result<CommandAcceptance, CodingError>

Accepts a prompt into one owned task; completion is observed separately.

§Errors

Rejects duplicate/overflowing owned runs and invalid prompt text.

Source

pub fn prompt_content( &self, session_id: SessionId, content: Vec<ContentBlock>, ) -> Result<CommandAcceptance, CodingError>

Accepts typed user content into one owned task.

§Errors

Rejects duplicate/overflowing owned runs and content that cannot form a canonical user message.

Source

pub async fn wait( &self, session_id: SessionId, ) -> Result<RuntimeCommandOutcome, CodingError>

Awaits and removes one owned run.

Source

pub async fn steer( &self, session_id: SessionId, text: impl Into<String>, ) -> Result<RuntimeCommandOutcome, CodingError>

Sends steering text to an active run.

Source

pub async fn follow_up( &self, session_id: SessionId, text: impl Into<String>, ) -> Result<RuntimeCommandOutcome, CodingError>

Queues a follow-up user message.

Source

pub async fn abort( &self, session_id: SessionId, ) -> Result<RuntimeCommandOutcome, CodingError>

Cancels an active run.

Source

pub fn approve( &self, session_id: SessionId, approval_id: ApprovalId, decision: ApprovalDecision, ) -> Result<CommandAcceptance, CodingError>

Accepts approval resolution into an owned continuation task.

Source

pub async fn set_model( &self, session_id: SessionId, model: ModelRef, ) -> Result<RuntimeCommandOutcome, CodingError>

Selects a model for future turns.

Source

pub async fn set_reasoning_effort( &self, session_id: SessionId, reasoning_effort: ReasoningEffort, ) -> Result<RuntimeCommandOutcome, CodingError>

Selects provider-neutral reasoning effort for future turns.

Source

pub async fn set_profile( &self, session_id: SessionId, profile_id: ProfileId, ) -> Result<RuntimeCommandOutcome, CodingError>

Selects a registered product profile for future turns.

Source

pub async fn set_active_tools( &self, session_id: SessionId, names: Vec<ToolName>, ) -> Result<(), CodingError>

Replaces the active tool set for future runs in this session.

Source

pub async fn compact( &self, session_id: SessionId, ) -> Result<RuntimeCommandOutcome, CodingError>

Requests manual compaction.

Source

pub async fn fork( &self, session_id: SessionId, from_message_id: MessageId, branch_id: BranchId, ) -> Result<RuntimeCommandOutcome, CodingError>

Forks and activates a branch from one message.

Source

pub async fn shutdown(&self)

Cancels active runtime runs, aborts task owners, and awaits shutdown.

Trait Implementations§

Source§

impl Debug for CodingAgentService

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CodingAgentService

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more