Skip to main content

OpencodeCtlServer

Struct OpencodeCtlServer 

Source
pub struct OpencodeCtlServer<T: Transport, C: Clock> {
    engine: Arc<Engine<T, C>>,
    tool_router: ToolRouter<Self>,
}

Fields§

§engine: Arc<Engine<T, C>>§tool_router: ToolRouter<Self>

Implementations§

Source§

impl<T: Transport, C: Clock> OpencodeCtlServer<T, C>

Source

pub fn new(engine: Arc<Engine<T, C>>) -> Self

Source§

impl<T: Transport, C: Clock> OpencodeCtlServer<T, C>

Source

pub fn service_status_tool_attr() -> Tool

Generated tool metadata function for service_status

Source

fn service_status( &self, Parameters: Parameters<ServiceStatusArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn service_start_tool_attr() -> Tool

Generated tool metadata function for service_start

Source

fn service_start( &self, Parameters: Parameters<ServiceStartArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn service_stop_tool_attr() -> Tool

Generated tool metadata function for service_stop

Source

fn service_stop( &self, Parameters: Parameters<ConfirmArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn service_restart_tool_attr() -> Tool

Generated tool metadata function for service_restart

Source

fn service_restart( &self, Parameters: Parameters<ConfirmArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_list_tool_attr() -> Tool

Generated tool metadata function for session_list

Source

fn session_list( &self, Parameters: Parameters<SessionListArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_create_tool_attr() -> Tool

Generated tool metadata function for session_create

Source

fn session_create( &self, Parameters: Parameters<SessionCreateArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_get_tool_attr() -> Tool

Generated tool metadata function for session_get

Source

fn session_get( &self, Parameters: Parameters<SessionGetArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_prompt_tool_attr() -> Tool

Generated tool metadata function for session_prompt

Source

fn session_prompt( &self, Parameters: Parameters<SessionPromptArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_wait_tool_attr() -> Tool

Generated tool metadata function for session_wait

Source

fn session_wait( &self, Parameters: Parameters<SessionWaitArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_messages_tool_attr() -> Tool

Generated tool metadata function for session_messages

Source

fn session_messages( &self, Parameters: Parameters<SessionMessagesArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_changes_tool_attr() -> Tool

Generated tool metadata function for session_changes

Source

fn session_changes( &self, Parameters: Parameters<SessionChangesArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn workspace_status_tool_attr() -> Tool

Generated tool metadata function for workspace_status

Source

fn workspace_status( &self, Parameters: Parameters<WorkspaceStatusArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_interrupt_tool_attr() -> Tool

Generated tool metadata function for session_interrupt

Source

fn session_interrupt( &self, Parameters: Parameters<SessionInterruptArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn session_delete_tool_attr() -> Tool

Generated tool metadata function for session_delete

Source

fn session_delete( &self, Parameters: Parameters<SessionDeleteArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn permission_reply_tool_attr() -> Tool

Generated tool metadata function for permission_reply

Source

fn permission_reply( &self, Parameters: Parameters<PermissionReplyArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn form_reply_tool_attr() -> Tool

Generated tool metadata function for form_reply

Source

fn form_reply( &self, Parameters: Parameters<FormReplyArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn saved_permissions_tool_attr() -> Tool

Generated tool metadata function for saved_permissions

Source

fn saved_permissions( &self, Parameters: Parameters<SavedPermissionsArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn opencode_operations_tool_attr() -> Tool

Generated tool metadata function for opencode_operations

Source

fn opencode_operations( &self, Parameters: Parameters<OpencodeOperationsArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn opencode_api_tool_attr() -> Tool

Generated tool metadata function for opencode_api

Source

fn opencode_api( &self, Parameters: Parameters<OpencodeApiArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

pub fn pair_status_tool_attr() -> Tool

Generated tool metadata function for pair_status

Source

fn pair_status( &self, Parameters: Parameters<PairStatusArgs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, ErrorData>> + Send + '_>>

Source

fn tool_router() -> ToolRouter<Self>

Trait Implementations§

Source§

impl<T: Transport, C: Clock> ServerHandler for OpencodeCtlServer<T, C>

Source§

fn get_info(&self) -> ServerConfig

Source§

async fn call_tool( &self, request: CallToolRequestParams, context: RequestContext<RoleServer>, ) -> Result<CallToolResponse, ErrorData>

Handle a tools/call request from a client. Read more
Source§

async fn list_tools( &self, _request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> Result<ListToolsResult, ErrorData>

Source§

fn get_tool(&self, name: &str) -> Option<Tool>

Get a tool definition by name. Read more
§

fn ping( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

§

fn initialize( &self, request: InitializeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<InitializeResult, ErrorData>> + MaybeSendFuture

§

fn negotiate_initialize( &self, request: &InitializeRequestParams, ) -> Result<InitializeResult, ErrorData>

Build the initialize response for request, negotiating the protocol version against [Self::supported_protocol_versions]. Read more
§

fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>

Return the protocol versions supported by this server. Read more
§

fn discover( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<DiscoverResult, ErrorData>> + MaybeSendFuture

Return this server’s discovery information.
§

fn complete( &self, request: CompleteRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CompleteResult, ErrorData>> + MaybeSendFuture

§

fn set_level( &self, request: SetLevelRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

§

fn get_prompt( &self, request: GetPromptRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetPromptResponse, ErrorData>> + MaybeSendFuture

§

fn list_prompts( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListPromptsResult, ErrorData>> + MaybeSendFuture

§

fn list_resources( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourcesResult, ErrorData>> + MaybeSendFuture

§

fn list_resource_templates( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourceTemplatesResult, ErrorData>> + MaybeSendFuture

§

fn read_resource( &self, request: ReadResourceRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ReadResourceResponse, ErrorData>> + MaybeSendFuture

§

fn accepted_subscription_filter( &self, requested: &SubscriptionFilter, ) -> Option<SubscriptionFilter>

Return the subset of a requested notification filter this server accepts. Read more
§

fn listen( &self, context: SubscriptionContext, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

Run one established subscription until it is cancelled or closed gracefully. Read more
§

fn subscribe( &self, request: SubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

👎Deprecated:

resources/subscribe is legacy-only; implement accepted_subscription_filter and listen for protocol version 2026-07-28

§

fn unsubscribe( &self, request: UnsubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

👎Deprecated:

resources/unsubscribe is legacy-only; subscriptions/listen is cancelled through its request lifecycle

§

fn on_custom_request( &self, request: CustomRequest, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CustomResult, ErrorData>> + MaybeSendFuture

§

fn on_cancelled( &self, notification: CancelledNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture

§

fn on_progress( &self, notification: ProgressNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture

§

fn on_initialized( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture

§

fn on_roots_list_changed( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture

§

fn on_custom_notification( &self, notification: CustomNotification, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture

§

fn get_task( &self, request: GetTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetTaskResult, ErrorData>> + MaybeSendFuture

SEP-2663 tasks/get: return the current [DetailedTask] state.
§

fn update_task( &self, request: UpdateTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

SEP-2663 tasks/update: accept responses to outstanding in-task input requests. Returns an empty acknowledgement on success.
§

fn cancel_task( &self, request: CancelTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

SEP-2663 tasks/cancel: cooperative cancellation. Returns an empty acknowledgement; the task’s observable status may lag.

Auto Trait Implementations§

§

impl<T, C> !RefUnwindSafe for OpencodeCtlServer<T, C>

§

impl<T, C> !UnwindSafe for OpencodeCtlServer<T, C>

§

impl<T, C> Freeze for OpencodeCtlServer<T, C>

§

impl<T, C> Send for OpencodeCtlServer<T, C>

§

impl<T, C> Sync for OpencodeCtlServer<T, C>

§

impl<T, C> Unpin for OpencodeCtlServer<T, C>

§

impl<T, C> UnsafeUnpin for OpencodeCtlServer<T, C>

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
§

impl<R, S> DynService<R> for S
where R: ServiceRole, S: Service<R>,

§

fn handle_request( &self, request: <R as ServiceRole>::PeerReq, context: RequestContext<R>, ) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>

§

fn handle_notification( &self, notification: <R as ServiceRole>::PeerNot, context: NotificationContext<R>, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>

§

fn get_info(&self) -> <R as ServiceRole>::Info

§

fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>

See [Service::supported_protocol_versions].
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
§

impl<H> Service<RoleServer> for H
where H: ServerHandler,

§

async fn handle_request( &self, request: <RoleServer as ServiceRole>::PeerReq, context: RequestContext<RoleServer>, ) -> Result<<RoleServer as ServiceRole>::Resp, ErrorData>

§

async fn handle_notification( &self, notification: <RoleServer as ServiceRole>::PeerNot, context: NotificationContext<RoleServer>, ) -> Result<(), ErrorData>

§

fn get_info(&self) -> <RoleServer as ServiceRole>::Info

§

fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>

The protocol versions this service can speak, bounding what initialize negotiation may agree to. Read more
§

impl<S> ServiceExt<RoleServer> for S
where S: Service<RoleServer>,

§

fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<RoleServer, S>, ServerInitializeError>> + MaybeSendFuture
where T: IntoTransport<RoleServer, E, A>, E: Error + Send + Sync + 'static, S: Sized,

§

fn into_dyn(self) -> Box<dyn DynService<R>>

Convert this service to a dynamic boxed service Read more
§

fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + MaybeSendFuture
where T: IntoTransport<R, E, A>, E: Error + Send + Sync + 'static, Self: Sized,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

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
§

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

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